from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import smtplib
message = MIMEMultipart() message['from'] = "MIcheal francis" message['to'] = '[email protected]' message['subject'] = "This is a test" message.attach(MIMEText('Body'))
with smtplib.SMTP(host= ‘[email protected]’, port= 587) as smtp:
smtp.ehlo()
smtp.starttls()
smtp.login(‘[email protected]’, ‘password’)
smtp.send_message(message)
print(‘sent…’)
It’s keep showing me socket.gaierror,
Please what should I do. Thanks in advance