automatic mail sending

Hi all,

             I want to send an e-mail automatically from linux machine to any other domain like wise gmail.com or yahoo.co.in. We have MSexchange server as a mail server. How to send e-mail from command line to other mail-IDs via exchange server. Please help..

Thanks advance
Ashok.

First you need to configure sendmail to route mails to your exchange server (SMTP)

Modify /etc/mail/sendmail.cf
modify the line starting with DS to

DSmymailserver.mydomain.com

restart sendmail

service sendmail restart

from the command line :

mail -s "test subject" example@gmail.com  <press enter>
this is my test email

.