I am running a python code for sending an email from my Hotmail account. The code I am using is:
def initmail():
signin()
##if "gmail" in username:
## server = smtplib.SMTP('smtp.gmail.com', 587)
##if "hotmail" in username:
server = smtplib.SMTP('smtp.live.com', 587)
server.starttls()
server.login(username, password)
messenger()
msg = MIMEMultipart()
msg['From'] = username
msg['To'] = mailto
msg['Subject'] = subject
body = bodytext
msg.attach(MIMEText(body, 'plain'))
text = msg.as_string()
server.sendmail(username, mailto, text)
server.quit()
user enters the email address and password in signin function. But I get the following error:
Why is the code generating this error?