[FRPythoneers] e-mail from cgi

Rob Riggs rob at pangalactic.org
Mon Jun 3 13:26:00 MDT 2002

Sean Reifschneider wrote:

>On Mon, Jun 03, 2002 at 12:30:36PM -0600, J. Wayde Allen wrote:
>>wondering if there is a recommended way to generate the e-mail?  I was
>>just tinkering with the smtplib module, but am not too sure how to use it
>>yet.  Is this on the best module to use?
>I would do it using popen:
>local machine.  If you have to use a remote SMTP server, smtplib is
>probably the best way to go.

I like the smtplib way myself, even (or especially) with a local SMTP 
server. With a local SMTP server, you can be fairly sure that all 
recipients will be accepted and queueing will be handled by the local 
MTA. The interface is (IMO) much cleaner and less error-prone then 
piping data to "sendmail". Jim's smtplib example is an excellent one. 
One of the many benefits is that one need not construct headers with the 
list of recipients. This is of more significant value when the number of 
recipients is variable.


More information about the FRPythoneers mailing list