Send email via the command line

I am looking to be able to check if my yahoo mail has any emails from the command line and also to send emails.

I am looking at sendmail.

Jeez, what a complicated process.

Is there something less challenging?
(I know I can use my browser for that.)

Thanks.

I think that this could be what you're looking for :slight_smile:

Probably Alpine would fit your usecase.

1 Like

Remember that emails are commonly sent in both text and html these days. Most sent ones are html. Anything you receive with any fonts or sizes or bold or italics was sent html

Likely you will only be able to receive text emails on a CLI, because there isn't a browser to render html. And likely no attachment handling either.

I'd love to mandate that all who send me emails only use text. (And I'd love to mandate they sign with a certificate. And I'd love a million dollars in the mail. All three have about the same likelihood.)

2 Likes

I am configuring Alpine. But can not find where to enter my password for yahoo email?

This might help:

https://www.ratfactor.com/slackware/alpine

You could use mutt (sudo apt install mutt). Create a ~/.muttrc (see example below) but instead of using your password, you need to log on to your yahoo.com email and create a one time password according to this link, Download your email from Yahoo Mail with IMAP | Yahoo Help - SLN28681

mutt will fetch your emails from yahoo

# about me
set from = "[email protected]"
set realname = "first last"

# credentials
set imap_user = "[email protected]"
set imap_pass = "here goes the one time pw yahoo will give you"
set ssl_starttls = yes
set ssl_force_tls = yes

set smtp_url = "smtp://$imap_user:[email protected]:587/"

# mailbox
set folder = "imaps://export.imap.mail.yahoo.com:993"
set spoolfile = "+INBOX"
2 Likes

Thanks so much. :slight_smile:

I successfully downloaded my messages.

I tried to send a message to myself and got
SMTP session failed: 550 Request failed; Mailbox unavailable

However, I can reply to messages and sent one to another email successfully.

As I have used mutt, I definitely see your points. :slight_smile:

I just found out that yahoo mail is blocking any receipt of messages sent by any cli mail program.

I can send message just fine to gmail.

Mutt has it uses if one is in a pinch and can't install a browser. :slight_smile: