LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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


Reply
  Search this Thread
Old 09-10-2006, 02:35 AM   #1
will824
Member
 
Registered: Jun 2003
Location: Medellin Colombia
Distribution: Gentoo
Posts: 35

Rep: Reputation: 15
Exclamation 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.
 
Old 09-10-2006, 07:13 AM   #2
jonaskoelker
Senior Member
 
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524

Rep: Reputation: 47
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.
 
Old 09-10-2006, 07:19 AM   #3
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
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.
 
Old 09-11-2006, 01:20 AM   #4
will824
Member
 
Registered: Jun 2003
Location: Medellin Colombia
Distribution: Gentoo
Posts: 35

Original Poster
Rep: Reputation: 15
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.
 
Old 09-13-2006, 04:23 AM   #5
will824
Member
 
Registered: Jun 2003
Location: Medellin Colombia
Distribution: Gentoo
Posts: 35

Original Poster
Rep: Reputation: 15
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!
 
Old 09-13-2006, 05:41 AM   #6
will824
Member
 
Registered: Jun 2003
Location: Medellin Colombia
Distribution: Gentoo
Posts: 35

Original Poster
Rep: Reputation: 15
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!!!
 
Old 09-14-2006, 09:00 AM   #7
will824
Member
 
Registered: Jun 2003
Location: Medellin Colombia
Distribution: Gentoo
Posts: 35

Original Poster
Rep: Reputation: 15
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!
 
Old 09-14-2006, 01:40 PM   #8
jonaskoelker
Senior Member
 
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524

Rep: Reputation: 47
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?
 
Old 09-14-2006, 10:26 PM   #9
will824
Member
 
Registered: Jun 2003
Location: Medellin Colombia
Distribution: Gentoo
Posts: 35

Original Poster
Rep: Reputation: 15
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Blocking mails from specific email addresses/domains in postfix jomy Linux - Networking 1 07-15-2008 08:32 PM
Can't send mails out to the internet gubak Linux - Networking 15 08-24-2004 06:54 AM
send mails with attachment ProXXXy Linux - Networking 2 08-18-2004 03:33 AM
HELP!!! Cannot send mails in SLACKWARE 9.1 vinay_s_s Linux - Software 5 03-24-2004 08:48 AM
Send Email + Txt Attachment Using Cron Job beringer Linux - Newbie 3 01-31-2003 10:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration