-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtxt.py
43 lines (32 loc) · 1004 Bytes
/
txt.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Python 3.7
# File name:
# Authors: Aaron Watt
# Date: 2021-07-09
"""Sending text messages over Aaron's gmail account."""
# Standard library imports
import smtplib
import ssl
# Third-party imports
# Local application imports
# GLOBALS ----------------------------
# FUNCTIONS --------------------------
def send_text(subject, body):
port = 465 # For SSL
smtp_server = "smtp.gmail.com"
sender_email = "[email protected]" # Enter your address
receiver_email = '[email protected]' # Enter receiver address
password = 'ktziyuaefqmbhxgh'
message = f"""
Subject: {subject}
{body}
"""
context = ssl.create_default_context()
with smtplib.SMTP_SSL(smtp_server, port, context=context) as server:
server.login(sender_email, password)
server.sendmail(sender_email, receiver_email, message)
# MAIN -------------------------------
if __name__ == "__main__":
send_text()
# REFERENCES -------------------------
"""
"""