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