Hardware Reference
In-Depth Information
SMTP SSL Encryption
he code in Listing 13-6 will send an e-mail using SMTP SSL encryption.
Listing 13-6 Send E-mail Using SSL
#!/usr/bin/env python
“””
Home Automation: send e-mail using SSL encryption
For the Raspberry Pi
“””
import sys
import smtplib
from email.mime.text import MIMEText
def SendEmail(MessageText):
#enter the e-mail account username between the quotes
smtp_user = “”
#enter the e-mail account password between the quotes
smtp_pass = “”
#sys.argv[1] is the 1st parameter that is passed to
#this program and it contains the text for the body
#of the e-mail
msg = MIMEText(MessageText)
#enter the target e-mail address between the quotes
msg['To'] = “”
#enter the e-mail account username between the quotes
msg['From'] = “”
#enter the message subject between the quotes
msg['Subject'] = “”
#enter the SMTP server URL or IP Address between the quotes
continued
Search WWH ::




Custom Search