mail / how to send a pre-composed multiple mail file?
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > mail / how to send a pre-composed multiple mail file?




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    mail / how to send a pre-composed multiple mail file?  
rhXX


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-29-07 12:34 PM

hi all,

i would appreciatte your comments on the following:

- i want to prepare a text file with some format similar to:

From: me
To: dest1
Subject: subject1

body1

From: me
To: dest2
Subject: subject2

body2

...


From: me
To: destN
Subject: subjectN

bodyN

- then feed it to some program:      xxx < file   , which send these
mails

i tried to do that with mail & mailx, but doesnot word, they need the
destination in the command line

tks in advance





[ Post a follow-up to this message ]



    Re: mail / how to send a pre-composed multiple mail file?  
rhXX


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-29-07 06:30 PM

On Nov 29, 2:45 pm, J de Boyne Pollard <j.deboynepoll...@tesco.net>
wrote:
> Either Batch SMTP or the UUCP "rmail" utility are your friends.

tks a lot!

i was looking for rmail and bsmtp but i don't have those packages   :-
(

i think the better way is to make a little prog in Python which parses
the file, and send the emails (???)





[ Post a follow-up to this message ]



    Re: mail / how to send a pre-composed multiple mail file?  
Logan Shaw


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-30-07 06:47 AM

rhXX wrote:
> - i want to prepare a text file with some format similar to:
>
> From: me
> To: dest1
> Subject: subject1
>
> body1
>
> From: me
> To: dest2
> Subject: subject2
>
> body2
>

> - then feed it to some program:      xxx < file   , which send these
> mails
>
> i tried to do that with mail & mailx, but doesnot word, they need the
> destination in the command line

"sendmail -t" would do what you want if you had each message in a separate
file.  The "-t" flag says to "t"ake the addresses from the message header
instead of the command line.

If you really need to get the messages out of a concatenated file, you
might be able to do it with formail.  (It depends on how liberal its parsing
is, since I believe it expects mbox format, which would have messages
beginning with "From " -- note no colon.)  But then you'd still be running
sendmail once for every message.

- Logan





[ Post a follow-up to this message ]



    Re: mail / how to send a pre-composed multiple mail file?  
rhXX


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-30-07 12:35 PM


> It all depends from how the file is constructed in the first place.
> If it is constructed, for example, by concatenating a series of
> individual message files together, then it's silly to write a program
> to parse the file in order to split it into several individual
> messages when it started off as several individual messages in the
> first place.  If you have individual messages in individual files,
> then submitting them is no more than an exercise in shell scripting.

ok, tks!

yes, yesterday i solved my problem with a shell scritp ...

with more details, i wanted to make a cron mail-merge:
- i have a .xls database with language, name, sex & number, treatment,
signing, ...., generic body file
- i exported this db to a .csv file
- i have some generic body files - language
- i cronned my "mail-merge" script
- for each csv record, it takes the associate body-language file,
makes the translation of the fields, and send the mail.

tks for your comments!
my best regards






[ Post a follow-up to this message ]



    Re: mail / how to send a pre-composed multiple mail file?  
rhXX


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-30-07 12:35 PM

> "sendmail -t" would do what you want if you had each message in a separate
> file.  The "-t" flag says to "t"ake the addresses from the message header
> instead of the command line.
>
> If you really need to get the messages out of a concatenated file, you
> might be able to do it with formail.  (It depends on how liberal its parsi
ng
> is, since I believe it expects mbox format, which would have messages
> beginning with "From " -- note no colon.)  But then you'd still be running
> sendmail once for every message.
>
>    - Logan

i will test it!

tks a lot!









[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 04:07 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register