EDIT: Thanks y’all! I got this working by installing mutt and configuring it with my Gmail info. Please note the warning from u/jherazob below–if this were something mission critical I would not want to rely on this solution.

================

Noob question incoming, thanks in advance for any help with this!

I have a specific use case in which I want to send an automated email or text to myself once a day (the message is different each time–otherwise I would just set an alarm, lol!). I’m running Pop_OS on an old desktop computer. Where I’m stuck is getting an email to successfully send from the command line. I’m looking for easy-to-follow instructions that would help me do that, and none of the articles or videos I’ve come across thus far have helped.

I’m aware of Twilio and other services that send SMS messages, but I’m looking for something free. Especially since I only need to text one person (myself), and infrequently at that.

Below is my attempt to send an email with the telnet command. Nothing ever came through…

XXXXXXXX@pop-os:~$ telnet localhost smtp
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 pop-os ESMTP Exim 4.95 Ubuntu Sun, 07 Jan 2024 15:12:28 -0500
HELO gmail.com
250 pop-os Hello localhost [::1]
mail from: XXXXXXXX@gmail.com
250 OK
rcpt to: XXXXXXXX@gmail.com
250 Accepted
data
354 Enter message, ending with "." on a line by itself
Subject: Test
Body: Is this working?
.
250 OK id=1rMZW4-0002dj-Uy
quit
4 points

You could probably do something with tasker to create these daily notifications

permalink
report
reply
3 points

Ah, you mean run the script directly on the phone without involving the desktop computer? I hadn’t considered that but it’s a great suggestion. Thanks!

permalink
report
parent
reply
3 points

You’re going to have to use an external service for email perhaps connected to something like Postfix or just using the email provider’s API - something else to think of if you just need something on your phone as a message / reminder is to use KDE Connect like in this tutorial https://doronbehar.com/articles/using-kdeconnect-to-comfortably-send-sms-messages-from-the-shell/

permalink
report
reply
1 point

Thank you!

permalink
report
parent
reply
5 points

Standard tool to send email is mailx, it is also often aliased as mail.

permalink
report
reply
1 point

Lots of valid suggestions already here. But I’ll throw one more to the pile. You could use the Pushbullet free plan (100 notifications per month). And then either use a python library or Google for a bash script to help with getting the notifications out. Then have Pushbullet installed on your phone.

permalink
report
reply
7 points

Implementing a telegram or discord bot might be easier

permalink
report
reply

Programming

!programming@beehaw.org

Create post

All things programming and coding related. Subcommunity of Technology.


This community’s icon was made by Aaron Schneider, under the CC-BY-NC-SA 4.0 license.

Community stats

  • 153

    Monthly active users

  • 313

    Posts

  • 3.3K

    Comments