I want to login me a my Hotmail's account, with the module smtplib in python3. But I have a problem. The account's password has special characters. I have:
#!/usr/bin/python3
import smtplib
server=str(input("server: "))
email=str(input("email: "))
password="p@sswordñ!"
smtp=smtplib.SMTP(server,587)
smtp.ehlo()
smtp.starttls()
smtp.login(email,password)
My error:
UnicodeEncodeError: 'ascii' codec can't encode character '\xf1' in position 1: ordinal not in range(128)
How Can I solve it?