Created
August 14, 2019 07:14
-
-
Save iomarmochtar/92a75e27ff1a9984171a4cdc8a9d9e82 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 random | |
fromaddr = '[email protected]' | |
toaddrs = '[email protected]' | |
subject = 'This can be a fraud' | |
message_id = '%032x@randommail'%random.getrandbits(128) | |
username = 'mcuser' | |
password = 'mcpassword' | |
msg = '''Message-ID: <{}> | |
Subject: {} | |
From: {} | |
To: {} | |
MIME-Version: 1.0 | |
Content-Type: text/html; charset=utf-8 | |
Content-Transfer-Encoding: quoted-printable | |
<h1>Hello world</h1> | |
'''.format(message_id, subject, fromaddr, toaddrs) | |
server = smtplib.SMTP('smtp.mailchannels.net:587') | |
server.starttls() | |
server.login(username,password) | |
server.sendmail(fromaddr, toaddrs, msg) | |
server.quit() | |
print('Sent') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment