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.
1 parent e2a78d4 commit 4d6f44dCopy full SHA for 4d6f44d
1 file changed
sen_email
@@ -0,0 +1,28 @@
1
+import smtplib
2
+import ssl
3
+from email.mime.multipart import MIMEMultipart
4
+from email.mime.text import MIMEText
5
+
6
+try:
7
+ email = "<< Enter your email >>"
8
+ password = "<< Enter your password"
9
+ to = "<< Enter sender email >>"
10
+ msg = """ << Email Body >>"""
11
+ message = MIMEMultipart()
12
+ message["From"] = email
13
+ message["To"] = to
14
+ message["Subject"] = "HacktoberFest 2019"
15
+ message.attach(MIMEText(msg, "plain"))
16
+ context = ssl.create_default_context()
17
+ server = smtplib.SMTP("smtp.gmail.com")
18
+ server.starttls()
19
+ server.ehlo()
20
+ server.login(email, password)
21
+ server.sendmail(email, to, message.as_string())
22
+ print('Email have been successfully send')
23
24
+except Exception as ex:
25
+ print(ex)
26
27
+finally:
28
+ server.quit()
0 commit comments