Use mailx along with a .mailrc file? Once .mailrc is set up it should just need:
$ echo 'is this working?' | mailx -s Test
Not sure exactly what .mailrc needs for gmail but there are tons of guides out there.
Welcome to the Python community on the programming.dev Lemmy instance!
Past
November 2023
October 2023
July 2023
August 2023
September 2023
Use mailx along with a .mailrc file? Once .mailrc is set up it should just need:
$ echo 'is this working?' | mailx -s Test
Not sure exactly what .mailrc needs for gmail but there are tons of guides out there.
Mailx is exactly what I use to send email from servers for cron jobs. Works great.
yes, i use mutt for this purpose. since most email addresses these days will only accept mail from a validated email server, you can hard code your email creds into mutt to send the email 'from' many email providers, including gmail
I want to add that Gmail is a bit of a dick when it comes to SMTP.
SMS obviously won't be free, aside from the aforementioned email solution, what about other services such as Discord/Teams/Slack?
Sending a message via any of them is rather trivia - Discord has a webhook API as well as a python wrapper.
Me and the SO have our own server and individual channels for ourselves where I use some webhooks to post stuff from Home Assistant for notifications
Yes, you can. Python has Email package to manage email through STMP protocol. I use it daily in my scripts. Attached link is a tutorial of Real Python: