I want to send an email from a google mail account so that the sender
name will be 'User Name' instead of '[email protected]' 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('[email protected]','somepassword')
>>>g.sendmail('User Name','[email protected]','From: User Name\r\nTo: 
>>>[email protected]\r\nsubject: how r u ?\r\nfoobar')
{}
>>>g.quit()

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

Reply via email to