sendmail a long message

H

Helmut Jarausch

Hi,

to send a possibly long email I have seen a solution
which does os.popen to an external sendmail program and
then writes the message into that pipe.

I wonder if it possible to use smtplib.SMTP.sendmail
but this requires building the complete body as one long
string in memory before calling this.

Is there an alternative solution, e.g. where
smtplib.SMTP.sendmail calls a generator.

Many thanks for a hint,


Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany
 
L

Laszlo Nagy

Helmut said:
Hi,

to send a possibly long email I have seen a solution
which does os.popen to an external sendmail program and
then writes the message into that pipe.

I wonder if it possible to use smtplib.SMTP.sendmail
but this requires building the complete body as one long
string in memory before calling this.

Is there an alternative solution, e.g. where
smtplib.SMTP.sendmail calls a generator.
using socket.connect, and feed the message body into it in smaller chunks.

Of course, you need to create the message body first, but it was not
your question - I suppose you already have the message stored on disk?
 
H

Helmut Jarausch

Laszlo said:
using socket.connect, and feed the message body into it in smaller chunks.

Of course, you need to create the message body first, but it was not
your question - I suppose you already have the message stored on disk?

Thanks,
it's a mail filter, the message is read in smaller chunks from sys.stdin .
Helmut.


--
Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,167
Latest member
SusanaSwan
Top