how to send email using "mail" to google or yahoo

hi all,

i need to email the output of a command to a google or yahoo account.
am using debian lenny 5.
can someone please help me on this ?

you can use the regular mailx command to do that:

echo "test message" | mailx -s "Test subject" xyz@gmail.com

In some corporate systems, the unix smtp server is configured to not allow emails outside the company domain. Adding a return email address using the -r flag usually fixes that:

echo "test message" | mailx -r you@yourcompany.com -s "Test subject" xyz@gmail.com

What I used on Debian 5 (with HushMail, though): sendemail

thanks.
works great without the -r option.
i can send to gmail.

now,how do i send to an internal mail server that uses ssl for smtp ??

Do you mean you do not want to use your local unix server's configured smtp to send mail?
In my understanding, you only have to worry about SSL if the server that you are using to send an email requires SSL. You don't have to worry about what the target server uses.

I think if you need more control over what SMTP to use to send an email, you can use the sendmail utility.

yes.. i want to specify an smtp to use.
ok. it means i have to use sendmail. thanks.