[X-Unix] how to send mail from commandline?

Eric F Crist ecrist at secure-computing.net
Thu Nov 10 13:19:08 PST 2005


On Nov 9, 2005, at 12:58 PM, Ben Gold wrote:

> I've wanted occasionally to be able to send an email from the  
> command line also.
>
> I've always wondered if there is no way to send one without turning  
> on Postfix?   I always thought it would be possible to simply send  
> out a message much like my Apple Mail program does – some command  
> where I type in the destination, message, AND my ISPs mail server.
>
> Is this not possible?
>
> Why do I need to run a server just to send an email?  If numerous  
> programs can connect to my ISPs mail server, why can't I?
>
> Or do I misunderstand that Postfix is a server, not a client?
>
> I don't know a lot about *nix, but I was hoping this was possible.

If you have access to a mail server, you can telnet to port 25 and  
send a text email that way.

See below:

[Swordfish:~] username% telnet grog 25
Trying 216.243.161.73...
Connected to grog.secure-computing.net.
Escape character is '^]'.
220 grog.secure-computing.net ESMTP Sendmail 8.13.1/8.13.1; Thu, 10  
Nov 2005 15:16:51 -0600 (CST)
helo snipe.secure-computing.net
250 grog.secure-computing.net Hello snipe.secure-computing.net  
[216.243.161.77], pleased to meet you
mail from: god at heaven.com
250 2.1.0 god at heaven.com... Sender ok
rcpt to: username at secure-computing.net
250 2.1.5 username at secure-computing.net... Recipient ok
data
354 Enter mail, end with "." on a line by itself
This is a test email.  I can type all of my text to send, followed by  
a . to end the email.
.
250 2.0.0 jAALGp7P044763 Message accepted for delivery
quit
221 2.0.0 grog.secure-computing.net closing connection
Connection closed by foreign host.


-----
Eric F Crist
Secure Computing Networks
http://www.secure-computing.net





More information about the X-Unix mailing list