send email from command line

Mark Haney mhaney at ercbroadband.org
Tue Sep 23 20:53:44 UTC 2008


mierda tuti wrote:
> Sorry I don't explain too well.
> 
> I would like to send e-mail outside of my lan, to send email to for example
> to someone gmail email
> 
> Many thanks!
> 

Please don't top post.

If you want to send a message from the command line, there are a lot of 
different ways.  Here are a few.  You don't say /what/ you want to send, 
so this might not all be useful.

1. Telnet to port 25 of the mail server you want.  (Not practical, BUT 
it works, I do it often when I need to test.)

2. Use a text mail client, pine, or mutt or something similar. I like 
pine, but that's personal preference.

3. Use the 'mail' command as stated in the previous post.  It usually 
looks like this:  mail -s "Subject: <whatever>" <recipient email> < text 
of email in text file.

I use this quite often in scripts to mail output of various commands to 
alert me to certain conditions or just mail output of a log to my email 
account.

Does that help?




-- 
Libenter homines id quod volunt credunt -- Caius Julius Caesar


Mark Haney
Sr. Systems Administrator
ERC Broadband
(828) 350-2415

Call (866) ERC-7110 for after hours support




More information about the ubuntu-users mailing list