i am using the smtplib module to send email from python script.
I would like to have a subject in the emails I send. but cant seem to figure out how to do that.
here's the script:
import smtplib
import string
fromaddr = 'foo@foo.com'
toaddr = 'foo@foo.com'
msg = ("From: %s\r\nTo: %s\r\n\r\n" % (fromaddr, toaddr))
msg += "test from python"
server = smtplib.SMTP('mail.foo.com')
server.set_debuglevel(1)
server.sendmail(fromaddr, toaddr, msg)
server.quit()
thanks
yann
I would like to have a subject in the emails I send. but cant seem to figure out how to do that.
here's the script:
import smtplib
import string
fromaddr = 'foo@foo.com'
toaddr = 'foo@foo.com'
msg = ("From: %s\r\nTo: %s\r\n\r\n" % (fromaddr, toaddr))
msg += "test from python"
server = smtplib.SMTP('mail.foo.com')
server.set_debuglevel(1)
server.sendmail(fromaddr, toaddr, msg)
server.quit()
thanks
yann