Many of Linux programming users want to send email from linux to exchange mailbox by Linux user name instead of the full email address.
There are many options but there is a easy way to send email from linux to exchange mailbox.
Let’s get started….
First you need to install sendmail or mailx or mailq.
After install successfully, go to /etc/mail/sendmail.cf and find the line # “Smart” relay host (may be null).
and add your exchange server IP address and save the file:
Restart sendmail service:
To send mail notification by user name instead full e-mail address.
edit /etc/aliases and add line with user name and e-mail address in the end of the file:
It’s time to test it:
You haven’t received an email to you outlook mailbox.
Run the command:
Fix it by deleting /etc/mail/sendmail.cf and create new sendmail.cf: