Created
July 21, 2013 03:55
-
-
Save shakkhar/6047409 to your computer and use it in GitHub Desktop.
Sending emails from python using smtplib
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import smtplib | |
from email.mime.text import MIMEText | |
msg = MIMEText("this is a test message") | |
s = smtplib.SMTP("__SMTP_SERVER_ADDRESS__") | |
s.starttls() | |
s.login("__SMTP_USER_NAME__","__SMTP_PASSWORD__") | |
s.sendmail("__SENDER_EMAIL__", ["__RECIPIENT_EMAIL__"], msg.as_string()) | |
s.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment