Created
May 18, 2021 19:15
-
-
Save goyuninfo/3b95f1e9631b283dc92b6074731c2771 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import smtplib | |
import email.message, email.policy, email.utils, sys | |
text = """This is a test""" | |
message = email.message.EmailMessage(email.policy.SMTP) | |
message['To'] = '[email protected]' | |
message['From'] = '[email protected]' | |
message['Subject'] = 'A test email' | |
message['Date'] = email.utils.formatdate(localtime=True) | |
message['Message-ID'] = email.utils.make_msgid() | |
message.set_content(text) | |
smtp = smtplib.SMTP("smtp.goyun.info") | |
smtp.starttls() | |
smtp.login('[email protected]','password') | |
smtp.sendmail('[email protected]', '[email protected]', message.as_string()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment