Add automated_email and name to README

This commit is contained in:
Suvigya 2019-10-11 15:17:14 +05:30
parent 760ba8492c
commit 51bac2e95a
4 changed files with 64 additions and 1 deletions

View File

@ -13,6 +13,7 @@ So far, the following projects have been integrated to this repo:
|--|--|
|[File Encrypt Decrypt](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/file-encrypt-decrypt)|[Aditya Arakeri](https://github.com/adityaarakeri)|
| [Address locator](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Location_Of_Adress) | [Chris]() |
| [Automated emails](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/automated_email) | [Suvigya](https://github.com/SuvigyaJain1) |
|[AI chatbot](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Artificial-intelligence_bot) |[umar abdullahi](https://github.com/umarbrowser) |
|[Asymmetric Encryption](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/asymmetric_cryptography) |[victor matheus](https://github.com/victormatheusc) |
|[Bitcoin price GUI](https://github.com/hastagAB/Awesome-Python-Scripts/tree/master/Bitcoin-Price-GUI) |[Amirul Abu](https://github.com/amirulabu) |

13
automated_email/README.md Normal file
View File

@ -0,0 +1,13 @@
#Automated email python script You can now send emails to multiple people at once easily with only a few clicks using smtplib module in Python
#Requirement Python version 3 and above smtplib json
```bash
pip install smtplib
pip install json
```
Can be run easily using commmand prompt (python automated_email.py)
-> login as you would for your gmail account( same email and password)
-> find your way with the intuitive user friendly menu
(!!!Your passwords and emails are only stored on your local device and no one has access to your information otherwise!!!)

View File

@ -0,0 +1,47 @@
from smtplib import SMTP as smtp
import json
def sendmail(sender_add, reciever_add, msg, password):
server = smtp('smtp.gmail.com:587')
server.starttls()
server.login(sender_add, password)
server.sendmail(sender_add, reciever_add, msg)
print("Mail sent succesfully....!")
group = {}
print('\t\t ......LOGIN.....')
your_add = input('Enter your email address :')
password = input('Enter your email password for login:')
print('\n\n\n\n')
choice = 'y'
while(choice != '3' or choice != 'no'):
print("\n 1.Create a group\n2.Message a group\n3.Exit")
choice = input()
if choice == '1':
ch = 'y'
while(ch != 'n'):
gname = input('Enter name of group :')
group[gname] = input('Enter contact emails separated by a single space :').rstrip()
ch = input('Add another....y/n? :').rstrip()
with open('groups.json', 'a') as f:
json.dump(group, f)
elif choice == '2':
gname = input('Enter name of group :')
try:
f = open('groups.json', 'r')
members = json.load(f)
f.close()
except:
print('Invalid group name. Please Create group first')
exit
members = members[gname].split()
msg = input('Enter message :')
for i in members:
try:
sendmail(your_add, i, msg, password)
except:
print("An unexpected error occured. Please try again later...")
continue
else:
break

View File

@ -0,0 +1,2 @@
smtplib
json