I want to be notify people via SMS when certain things happen. Seems like it should be pretty straighforward. But when the SMS arrives it has the sender and subject line in the message, and I can't figure out how to adjust the message to get rid of it.
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
message = MIMEMultipart()
message['From'] = "xyz@gmail.com"
message['To'] = "5551234567@tmomail.net"
message['Subject'] = "FOOBAR!"
text = "Hello, world!"
message.attach(MIMEText(text.encode("utf-8"), "plain", "utf-8"))
server = smtplib.SMTP("smtp.gmail.com", 587)
server.starttls()
server.login(message["From"], "SuperSecretString")
server.sendmail(message["From"], [message["To"]], text)
Produces something like:
xyz@gmail.com / FOOBAR!/ Hello, world!
, and all I want to see is Hello, world!