By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,217 Members | 1,379 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,217 IT Pros & Developers. It's quick & easy.

smtplib starttls gmail example

P: n/a
from smtplib import SMTP
from socket import sslerror #if desired
server = SMTP('')
server.set_debuglevel(0) # or 1 for verbosity
server.ehlo('y**********') # say hello again
server.login('y**********', 'yourpassword')
# i have a suspicion that smptlib does not add the required newline dot newline so i do it myself
server.sendmail('y**********', 'r*', message_text + '\n.\n')
# next line generates the ignorable socket.sslerror
Jan 23 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.