Quantcast
Channel: How to send mail from the command line? - Ask Ubuntu
Viewing all articles
Browse latest Browse all 18

Answer by hanoo for How to send mail from the command line?

$
0
0

You can send an email from the command line with TelNet or NetCat.

Everything is explained here.

hanoo@hp_laptop% nc 127.0.0.1 25
220 hp_laptop.localdomain ESMTP Postfix
EHLO man
250 hp_laptop.localdomain
MAIL FROM: <netcat@postfix.com>
250 2.1.0 Ok
RCPT TO: <target@host.com>
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
This is the body of my mail,
this is the second line...
.
250 2.0.0 Ok: queued as 9C12E7F404

Viewing all articles
Browse latest Browse all 18

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>