Answer the question
In order to leave comments, you need to log in
How to send/attach a picture?
There is a script in python 3, you need to send a text message everything is fine, but you still need to attach a photo how to do it? I tried using html markup to insert an image, it did not work.
My code at the moment
import smtplib
email = smtplib.SMTP('smtp.gmail.com', 587)
message = """From: <[email protected]>
To: Ivan
Content-type: text/html
Subject: SMTP e-mail test
This is a test e-mail message.
<h1>Hello</h1>
<b> Its ivan </b>
<img src="/Users/ivan/PycharmProjects/mail/user.jpg">
"""
email.starttls()
email.login('[email protected]', '********')
email.sendmail("[email protected]", "[email protected]", message)
email.quit()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question