send email via hotmail in python
问题 I want to send an email from my server. I'm trying to send using a hotmail account that I already have. user = "myaddress@hotmail.com" passwd = "xxxxxxxxx" from_addr = "myaddress@hotmail.com" to_addr = "someaddress@gmail.com" smtp_srv = "smtp.live.com" subject = "Home Server Uptime" message = "The server has been online for: %s" %(uptime) smtp = smtplib.SMTP(smtp_srv,587) smtp.ehlo() smtp.starttls() smtp.ehlo() smtp.login(user, passwd) smtp.sendmail(from_addr, to_addr, message) smtp.quit() I