Sending mail from 'current user' in Python
Leo Breebaart
leo at lspace.org
Tue Jun 14 05:04:01 EDT 2005
Marcus Alanen <marcus.alanen at abo.fi> writes:
> >>I've also tried opening a pipe to sendmail, and feeding the
> >>message to that instead. This too works great [but] doesn't
> >>seem like much of an improvement, portability-wise.
>
> No, but at least it can be expected to do the right thing
> w.r.t. sending the mail.
Good point.
> >>Finally, if at all possible I'd also like to get this working on
> >>Windows, so I'd rather stick with the standard smtplib if I can.
> > smtplib needs an SMTP server to connect to. For unix systems, this is
> > typically localhost. What do you use for Windows systems? Or are you
> > connecting to your machine to deliver the mail?
>
> I'd be very surprised if the typical SMTP server is localhost
> on unix-like computers. [...] Let the sendmail program take
> care of those details.
>
> The Unix Programming Frequently Asked Questions "Q5.2 What's the best
> way to send mail from a program?" is worth reading.
Thanks to you and everyone else who contributed to this thread.
I've now decided to accept the inherent non-portabilitiness of
the whole concept of 'sending mail from within a program', and
will be going with a Unix-only see-if-you-can-find-sendmail
approach.
--
Leo Breebaart <leo at kronto.org>
More information about the Python-list
mailing list