Larry Bates wrote: > brad wrote: >> I'd like to send email directly from within python without having to >> rely on an external smtp server. You know, something like the good, >> old Unix... >> >> echo My_message | mail -s Subject [EMAIL PROTECTED] >> >> Can Python do something similar in a portable fashion without a smtp >> server installed on the machine? >> >> Thanks, >> Brad > > smtp module can do what you want yes. > > -Larry The tricky part is how to resolve the mail server for a mail address. Usually you have to query the mx record of that domain. I solved that by looking if I can find the nslookup binary.
I already wrote a command line mailer that can do attachments too, no need to write it again. If anybody is interested I can open-source it. -- mph -- http://mail.python.org/mailman/listinfo/python-list