I want to send an email from a google mail account so that the sender
name will be 'User Name' instead of 'usern...@gmail.com' in the inbox.
this is the code I use:         (I'm using python 2.5)
>>>import smtplib
>>>g=smtplib.SMTP('smtp.googlemail.com')
>>>g.ehlo();g.starttls();g.ehlo()
>>>g.login('usern...@gmail.com','somepassword')
>>>g.sendmail('User Name','usern...@gmail.com','From: User Name\r\nTo: 
>>>usern...@gmail.com\r\nsubject: how r u ?\r\nfoobar')
{}
>>>g.quit()

but this doesn't work, what should I do ?
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to