Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4060

Python • Re: Send email from python

$
0
0
I use smtp2go. It's free for small personal use. If I remember correctly I get 100 emails per day. Enough for my needs.
My email address to send from is an outlook.com one.

Code:

            server=smtplib.SMTP('mail.smtp2go.com', 2525, timeout=8)            server.ehlo()            server.starttls()            server.ehlo()            server.login(CONST.EMAIL_ADDRESS_TO_SEND_FROM, CONST.SMPT2GO_PASSWORD)            msg = MIMEMultipart()            msg['Subject'] = "Data from Pi (RETRY)"            msg['From'] = CONST.EMAIL_ADDRESS_TO_SEND_FROM            msg['To'] = CONST.EMAIL_ADDRESS_TO_SEND_TO            msg.preamble = "Data from Pi (RETRY)"            # Add a short text message listing the minimum and maximum values for the previous 24hour period            msg.attach(MIMEText(_allMinMaxValues))

Statistics: Posted by MarkDH102 — Sun Oct 20, 2024 6:39 am



Viewing all articles
Browse latest Browse all 4060

Trending Articles