We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9976472 + e1bf62f commit 74cd41cCopy full SHA for 74cd41c
Scripts/send_mail.py
@@ -0,0 +1,22 @@
1
+# need to import the smtp lib
2
+import smptplib
3
+
4
5
+# TLS port = 587, normal_port=465
6
+smtp_obj = smtplib.SMTP('smtp.gmail.com', 587)
7
+print("TYPE_SMTP_OBJ", type(smtp_obj))
8
9
+smtp_obj.ehlo()
10
11
+#starttls() puts smtp in TLS mode
12
+smtp_obj.starttls()
13
14
+smtp_obj.login('email_address', 'password')
15
16
+sender_email_adress = 'abcd@efg.com'
17
+list_of_reciever_addresses = ['email_1@xxxx.com', 'email_2@xxxx.com']
18
19
+smtp_obj.sendemail(sender_email_address, list_of_reciever_addresses, 'Subject: the body of the message')
20
21
+#close the smtp obj when done
22
+smtp_obj.quit()
0 commit comments