Ask coding questions

← Back to all posts
Sending Emails with Python
[deleted]

How do I send emails with python, I've tried using:

import smtplib, ssl

port = 0 # For SSL
password = "URmom"

Create a secure SSL context

context = ssl.create_default_context()

with smtplib.SMTP_SSL("[email protected]", port, context=context) as server:
server.login("[email protected]", password)

Answered by VulcanWM [earned 5 cycles]
View Answer
Voters
ignaciocortescl
Comments
hotnewtop
VulcanWM

I recently made a reminder bot which sends emails using Python when you need to receive the reminder:
https://repl.it/talk/share/My-Reminder-Bot/45424

Mark this as the answer if it was helpful or useful

gibbsfreenergy

https://www.freecodecamp.org/news/send-emails-using-code-4fcea9df63f/

You can use this link also

If this helped then choose this as the answer you were looking for!

[deleted]

thanks everybody, this was super helpful.

gibbsfreenergy

Set up the SMTP server and log into your account.
Create the MIMEMultipart message object and load it with appropriate headers for From , To , and Subject fields.
Add your message body.
Send the message using the SMTP server object.

If this helped then choose this as the answer you were looking for!

adl212

So, what are you asking for?