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

Eric F Crist ecrist at secure-computing.net
Thu Nov 10 13:24:18 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.
>

sorry, accidentally hit send...

You can also send an email from the command line using the mail command:

[Swordfish:~] username% mail username at secure-computing.net
Subject: this is a test
This is another way to send an email.  Similar to the telnet method,  
I need to finish this email using a . on a line by itself.

.
EOT

You can attach a file using the following series of command:

[swordfish:~] username% mail username at secure-computing.net <  
testfile.txt

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





More information about the X-Unix mailing list