Hacker News new | ask | show | jobs
by murat124 1063 days ago
telnet host port

ehlo mailback

mail from: myemail@somewhere.com

rcpt to: whoever@anywhere.com

data

mail from: "my name" <myemail@somewhere.com>

rcpt to: "their name" <whoever@anywhere.com>

subject: whatever

mail text goes here but don't forget an empty line between subject line and this line (as a separator of header and body)

and here

and end mail text by a single dot in a single line like this

.

quit

for attachments or other advanced features you can use mutt, pine, or any other mail app. you can also do:

cat mail-text.txt | mail -s "subject goes here" whoever@anywhere.com

1 comments

Should be noted that telnet only works when you have unauthenticated access to your mail server.
I remember performing authentication via telnet session as well: https://susam.net/blog/auth-cram-md5.html (2011)

Of course, these days, the connection should be wrapped within a TLS session and openssl s_client could be a good alternative to telnet for doing that.