Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
09-10-2006, 03:35 AM
|
#1
|
Member
Registered: Jun 2003
Location: Medellin Colombia
Distribution: Gentoo
Posts: 35
Rep:
|
How can I send mails to multiple addresses in a txt file
Hi.
I am a monitor on Algorithms in my university. The course has around 400 Students, so I asked wach teacher to send me a xls file with all their mails. Now I need to seend bulk informative mail.
I could just create a grup of 30 students for each group in mozilla, but it would take a loooong time, time I dont really have and I find it quite inefficient.
So my question is if you know of a way automatize the sending of all 400 mails.
I really need help on this topic and havent been able to find information in the web.
Thanks in advance for all your help.
|
|
|
09-10-2006, 08:13 AM
|
#2
|
Senior Member
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524
Rep:
|
I think the best way would be to set up a mailing list and add all 400 people to it. If you can't do that, then do the following:
Code:
for recv in $(cat file-with-email-addresses.txt); do
mail -s "my favorite subject" $recv < content-of-email.txt
done
This assumes you have set up a mail transfer againt -- such as exim, postfix or sendmail -- which is reasonably easy, and you really should do anyways. If you ISP is an asshole (i.e. blocks outgoing 25/tcp), consider signing up for mailshack and using them as your smarthost on outgoing 2525/tcp.
|
|
|
09-10-2006, 08:19 AM
|
#3
|
LQ Addict
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908
|
Kmail can be setup to use defined mailing lists. Importing the email addresses from an xls file to the mailing list is beyond my ability to describe.
From the reading I've done, when composing new messages, elect to send the message to the mailing list instead of individual users, and the message goes out to all addresses in the list.
|
|
|
09-11-2006, 02:20 AM
|
#4
|
Member
Registered: Jun 2003
Location: Medellin Colombia
Distribution: Gentoo
Posts: 35
Original Poster
Rep:
|
Problem when sending mails to mail lists
bigrigdriver,
Actually, I have tried to send mail to Mail Lists with more than 40 users and most mail SMTP servers would answer that there are too many recipients to send the current mail (I believe it must be some way of controlling SPAM), so now I believe the only way its to do it they way jonaskoelker says so, like using a MTA agent with some programming.
jonaskoelker,
Man, thanks for the information, I am going to try and install a MTA and try the programming you sent me to see if it actually works.
Thanks, Ill post later to tell you about it.
|
|
|
09-13-2006, 05:23 AM
|
#5
|
Member
Registered: Jun 2003
Location: Medellin Colombia
Distribution: Gentoo
Posts: 35
Original Poster
Rep:
|
Hi
Hello!
Iam trying to send the mails using sendEmail and sendmail as the SMTP server, and It worked for a single Mail, but I have yet to do the programming.
How can you create a Mailinglist with 540 (There where more) mails and then get yout ISPs SMTP server to send mail at once to all those address (Normally it would give you an error).
Thanks!
|
|
|
09-13-2006, 06:41 AM
|
#6
|
Member
Registered: Jun 2003
Location: Medellin Colombia
Distribution: Gentoo
Posts: 35
Original Poster
Rep:
|
Ok, Seems it worked
Ok, this is the script I used and it seems that it worked ok
------------------------------------------------------
#Para enviar un correo a todos los estudiantes de algoritmos
msg=$(cat aypmsg12082006)
for adr in $(cat EstudiantesAlgoritmos); do
sendEmail -f "William Cornejo <wecornej@unalmed.edu.co>" \
-t \
$adr \
-u "Importante: Monitoria Algoritmos y Programacion 03-2006" \
-m "$msg" \
-s localhost \
-l logmails
done
-----------------------------------------------------
Thanks for all your help!!!
|
|
|
09-14-2006, 10:00 AM
|
#7
|
Member
Registered: Jun 2003
Location: Medellin Colombia
Distribution: Gentoo
Posts: 35
Original Poster
Rep:
|
MTA Used
Hi all!
I had forgotten to tell you that I didnt use my ISPs SMTP (No relay allowed), instead I installed sendmail (It worked with courier too) and I sent the message with the script via localhost port, as the relay was controlled by me and it was even enabled since the beginning.
I had a little question: It is possible with the script that I send messages to group of addresses instead of sending 540 for each one?. How could I make it and to how many addresses can I send a mail at the time.
Thanks!
|
|
|
09-14-2006, 02:40 PM
|
#8
|
Senior Member
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524
Rep:
|
To find out what the spec says, read the RFC. In reality it probably depends on the configuration of the first few MTAs. I would bet you that the first MTA looks at the message and splits it into one per recipient, simply because the delivery process is going to be different. Except maybe if it only needs to forward to a smarthost, in which case the smarthost probably splits it into many.
Which problem gets solved by you sending one message instead of many?
|
|
|
09-14-2006, 11:26 PM
|
#9
|
Member
Registered: Jun 2003
Location: Medellin Colombia
Distribution: Gentoo
Posts: 35
Original Poster
Rep:
|
Multiple
Hi!
Where could I find the RFC?
The thing is that if I send one mail with multiple addresses I will not have to send 540 mails, just 16, for example. So the communication with the SMTP server will be more eficient.
Thanks.
PD: One notice... thos emessages I sent.. they did not arrive to the mail addresses... I dont know what happened
|
|
|
All times are GMT -5. The time now is 12:07 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|