Computer Science | Artificial Intelligence | Computational Biology | Chess | Blender
import smtplib # Email variables sender_email = 'sender email' receiver_email = 'receiver email' password = 'an app password' subject = 'Subject of the Email' body = 'Body of the Email' # Configure email format email_format = f'{subject}\n\n{body}' # Check any exceptions and prepare email to be sent try: with smtplib.SMTP('smtp.gmail.com',587) as server: server.starttls() server.login(sender_email, password) server.sendmail(sender_email, receiver_email, email_format) print('Email Sent') # If an exception occurs except Exception as e: print(e)