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

0 votes
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 another. How do I do that?
Jun 11 in Python by Deb
18 views

1 answer to this question.

0 votes

Hi @Deb, try out the following code:

import smtplib 

# creates SMTP session

s = smtplib.SMTP('smtp.gmail.com', 587)

 # start TLS for security

s.starttls()

 # Authentication of sender email, add sender email id and password

s.login("email-id", "password")

# message to be sent

message = "Message-to-send"

# sending the mail

s.sendmail("sender_email_id", "receiver_email_id", message)

# terminating the session

s.quit()
answered Jun 11 by Picentra

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,160 points
25 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
86 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
• 3,320 points
17 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
40 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 122 views
+4 votes
6 answers
0 votes
1 answer

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

Hey @Varsha, you can try out the ...READ MORE

answered Jun 11 in Python by Travis
50 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 Jun 11 in Python by Adil
23 views