Python, Unix sendmail, and multiple recipients
skip at pobox.com
Tue Oct 16 18:08:17 CEST 2001
Randy> Can anyone give me an example of how to invoke the Unix sendmail
Randy> in Python, and send an email message to more then one recipient
Randy> (two people, for example)?
fwd = os.popen('/usr/sbin/sendmail -odb -t', 'w')
fwd.write('To: skip at mojam.com\n')
fwd.write('To: Randy.L.Kemp at motorola.com\n')
fwd.write('Subject: Hey there!\n')
where "body" is a list of newline-terminated strings.
Any particular reason why you don't want to use smtplib?
Skip Montanaro (skip at pobox.com)
More information about the Python-list