I wanted to quickly share the some quick start documentation for these two simple, yet powerful tasks, take a look. In just a few lines of code you could include email and sms messaging within your application.
Email me: email.ryan.kelly@gmail.com
import smtplib
from_add = "your_gmail@gmail.com"
to_addr = "recipient@email.com"
msg = "This message was sent with python!"
username = "your gmail username"
password = "password"
# Start the server using gmail's servers
server = smtplib.SMTP('smtp.gmail.com:587')
server.starttls()
server.login(username, password)
server.sendmail(from_add, from_add, msg)
# Log off
server.quit()
Feel free to try adding HTML messages and attachments using the python documentation
First you will have to signup for the free trial account
from twilio.rest import TwilioRestClient
# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "####"
auth_token = "####"
client = TwilioRestClient(account_sid, auth_token)
message = client.messages.create(
body="Hey Caity, I'm sending this from my computa!",
to="+######", # Replace with your recipient's phone number
from_="+######") # Replace with your Twilio number
print message.sid # Check send confirmation
Link to the twilio website API.