recipients = ['recipient_id@yahoo.com']
sender = 'sender_id@gmail.com'
subject = 'report reminder'
body = """
Dear Student,
Please send your report
Thank you for your attention
"""
msg = MIMEText(body)
msg['Subject'] = subject
msg['From'] = sender
msg['To'] = ', '.join(recipients)
session = smtplib.SMTP('smtp.gmail.com', 587)
session.starttls()
session.login(sender, 'my password')
send_it = session.sendmail(sender, recipients, msg.as_string())
session.quit()
How to get line breaks in e-mail sent using Python's smtplib?