forked from neelshah2409/Bot-Collection
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbulk_email_automation.py
34 lines (28 loc) · 917 Bytes
/
bulk_email_automation.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
import smtplib
def getting_login_credentials():
email=input("Enter your email address")
password=input("Enter password")
return email,password
def getting_senders_email_address():
n=int(input("enter the number of users"))
emails=[]
for i in range(n):
email=input("enter the email")
emails.append(email)
return emails
def getting_message_to_send():
message=input("Enter the message")
return message
def sending_automated_mails(email,password,receiver_emails,message):
smtp = smtplib.SMTP('smtp.gmail.com', 587)
smtp.ehlo()
smtp.starttls()
smtp.login(email, password)
to = receiver_emails
smtp.sendmail(from_addr=email,
to_addrs=to, msg=message)
smtp.quit()
email,password=getting_login_credentials()
receiver_emails=getting_senders_email_address()
message=getting_message_to_send()
sending_automated_mails(email,password,receiver_emails,message)