Python code to send an email message from my gmail to many others

0 votes
I'm in my final year of engineering. I'm doing engineering in the field of computer science. I have a project which requires me to write a python code such that you can send an email message from one email ID to many others. How do I do that?
6 days ago in Python by Varsha
49 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

Hey @Varsha, you can try out the following code:

import smtplib 

# list of email_id to send the mail
list = ["abc@gmail.com", "def@gmail.com"] 

for i in range(len(list)):
    s = smtplib.SMTP('smtp.gmail.com', 587)
    s.starttls() 

#sender emai id and email password
    s.login("email-id", "id-password")
    message = "Message-to-send"
    s.sendmail("sender_email_id", list[i], message)
    s.quit() 
answered 6 days ago by Travis

Related Questions In Python

0 votes
1 answer

I'm using Python 2.7 to convert an XML response (from a REST call to Atlassian Fisheye) into an HTML table.

You don't have a template matching tabularQueryResult in your ...READ MORE

answered Oct 4, 2018 in Python by Priyaj
• 56,140 points
21 views
0 votes
1 answer

How to correctly return an a dictionary as an output in zappier code using python?

David here, from the Zapier Platform team. ...READ MORE

answered Dec 3, 2018 in Python by charlie_brown
• 7,710 points
70 views
0 votes
0 answers

can i send an email using python?

can you give me the exact code ...READ MORE

Apr 4 in Python by Waseem
• 2,670 points
16 views
0 votes
1 answer

How to get status code from Python Requests?

Here's how you can get the status ...READ MORE

answered May 13 in Python by Rasheed
11 views
0 votes
1 answer

how can i count the items in a list?

suppose you have a list a = [0,1,2,3,4,5,6,7,8,9,10] now ...READ MORE

answered May 2 in Python by Mohammad
• 1,400 points
55 views
+4 votes
6 answers
0 votes
1 answer

Python code to send an email message from 1 email id to another

Hi @Deb, try out the following code: import ...READ MORE

answered 6 days ago in Python by Picentra
15 views
0 votes
1 answer

Python code to send an email with an attachment

Hi @Vipul, try out this code. I've ...READ MORE

answered 6 days ago in Python by Adil
16 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.