I have a job setup to run daily that will send me a text reminder. The reminder is sent to me successfully, but not matter what I use for my “message” the last two characters are cut off.
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from dotenv import dotenv_values
import os
secrets = dotenv_values()
email = secrets['EMAIL']
password = secrets['EMAIL_PASSWORD']
recipient = secrets['RECIPIENT']
auth = (email, password)
msg = MIMEMultipart()
msg["Subject"] = "Chicken Alarm"
msg["From"] = email
msg["To"] = recipient
message = "It's chicken time"
msg.attach(MIMEText(message, 'plain'))
server = smtplib.SMTP("smtp.gmail.com", 587)
server.starttls()
server.login(auth[0], auth[1])
text = msg.as_string()
server.sendmail(auth[0], recipient, text)
server.quit()
What’s going on that would be causing the last two characters to get cut off?