From 79eab2fcb56151abbe4bcc8475b31ffb266bcef0 Mon Sep 17 00:00:00 2001 From: abhaypartap12 Date: Sat, 4 Dec 2021 19:22:11 +0530 Subject: [PATCH 1/2] Simplest Script To Send Email --- projects/Send_Email/Readme.md | 29 +++++++++++++++++++++++++++++ projects/Send_Email/Send_Email.py | 8 ++++++++ 2 files changed, 37 insertions(+) create mode 100644 projects/Send_Email/Readme.md create mode 100644 projects/Send_Email/Send_Email.py diff --git a/projects/Send_Email/Readme.md b/projects/Send_Email/Readme.md new file mode 100644 index 000000000..04edb02f3 --- /dev/null +++ b/projects/Send_Email/Readme.md @@ -0,0 +1,29 @@ +# Simplest Script To Send Email Using Python + +### Prerequisites + +Install yagmail library + +``` +pip3 install yagmail +``` + +### Running The Script:- + +The script requires:- +1. yourmail@gmail.com +2. Sender Name you want to display +3. Auth Password:- [Google Support Link] (https://support.google.com/accounts/answer/185833?hl=en) + > Generate it using this process explained +4. sendermail@gmail.com +5. body message + +Once you have all these just run:- + +``` +python3 Send_Email.py +``` + +## *Abhay Partap Singh* :star_struck: +[Github] (https://github.com/abhaypartap12) +[LinkedIn] (https://www.linkedin.com/in/abhay-partap-singh-aa2898165/) diff --git a/projects/Send_Email/Send_Email.py b/projects/Send_Email/Send_Email.py new file mode 100644 index 000000000..8c2bc0229 --- /dev/null +++ b/projects/Send_Email/Send_Email.py @@ -0,0 +1,8 @@ +import yagmail + +body = "Hello" + +mail = yagmail.SMTP({"yourmail@gmail.com":"Sender Name"},"Auth Password") +mail.send(to="receiver@gmail.com",subject="Test Mail",contents=body) + + From ffeab89ea13f6aa00193cef18722ccb7f26bfbe1 Mon Sep 17 00:00:00 2001 From: abhaypartap12 Date: Sat, 4 Dec 2021 19:29:05 +0530 Subject: [PATCH 2/2] Updated Readme --- projects/Send_Email/Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/Send_Email/Readme.md b/projects/Send_Email/Readme.md index 04edb02f3..faa3b7d18 100644 --- a/projects/Send_Email/Readme.md +++ b/projects/Send_Email/Readme.md @@ -14,7 +14,7 @@ The script requires:- 1. yourmail@gmail.com 2. Sender Name you want to display 3. Auth Password:- [Google Support Link] (https://support.google.com/accounts/answer/185833?hl=en) - > Generate it using this process explained + Generate it using this process explained 4. sendermail@gmail.com 5. body message