goal: send a SMS message using python.
Google eventually lead to the smtp library and then my code became:
import smtplib
import imaplib
import email
#emailAddress = "[email protected]"
#emailPassword = "appPassword"
#phoneAddress = "[email protected]"
from config import emailAddress, emailPassword, phoneAddress
message = "testing test test"
smtpServer = "smtp.gmail.com"
server = smtplib.SMTP_SSL(smtpServer, 465)
server.ehlo()
server.login(emailAddress, emailPassword)
server.sendmail(emailAddress, phoneAddress, message)
server.quit()
The above code works when I changed the phone address to someone with Bell. When it was Rogers and Fido I could see the sent message on my email account, but the SMS never came. No error pops up in shell either.
Does anyone know why this happens?
I use Fast2sms. it has some free limit, just go to their website signup and create an authorization code. signup and go to this link to get auth code https://www.fast2sms.com/dashboard/dev-api
They will ask credits for sending sms to DND Numbers