Link to home
Start Free TrialLog in
Avatar of astar666
astar666Flag for United States of America

asked on

python email from web cgi

Consider this:

def emailmessage(message):
      email="From: root@tacomaliteracy.org\r\nTo: tutorregistration@tacomaliteracy.org\r\nSubject: tutor registration\r\n\r\n"+message
      server = smtplib.SMTP('localhost')
      server.sendmail("root@tacomaliteracy.org", "tutorregistration@tacomaliteracy.org,astar@spamcop.net", email)
      server.quit()

Look at the second to last physical and logical line and you note I have two emails to which I am sending the email message.  My reading of the library doc suggests this is the correct format.  In practice, it works only if there is one and only one to address.  You might think sendmail needs configuring, but each of the above two addresses work individually.

Please advise.
ASKER CERTIFIED SOLUTION
Avatar of RichieHindle
RichieHindle

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial