Make sure your mailserver is properly set up and mails not considered as SPAM. Take a look at this checklist: http://www.linuxmail.info/mail-server-checklist/
Mail servers usually depend on the local host file.
The format must be <IP Adress> <full qualified domain name> <host name> <alias 1> <alias 2> etc.
# Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 localhost.localdomain localhost ::1 localhost6.localdomain6 localhost6 184.108.40.206 eul0001162-vmware2.eu.verio.net eul0001162-vmware2 eul0001162vmc 192.168.63.233 eul0001162-vmware2.eu.verio.net eul0001162-vmware2 eul0001162vmc 192.168.214.131 eul0001162-vmware2.eu.verio.net eul0001162-vmware2 eul0001162vmc
Following the setup above the mail server is going to use put a correct domain name in the header:
Received: from eul0001162-vmware2.eu.verio.net (eul0001162-vmware2.eu.verio.net [220.127.116.11])
You will still be able to send emails with another sender address domain. As example you could still send mails as firstname.lastname@example.org just make sure the IP of the mailserver is allowed in DNS (as MX or over a SPF record).
Take a look at the online documentation.
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
egrep -i "(stat=[^Sent])+" /var/log/maillog | less
$ mail -s "Testmail" email@example.com Hello, I'm just sending a testmail... [Ctrl + D] Cc: [Enter]
php -r "mail('firstname.lastname@example.org', 'The subject' , 'put your text here', '');"
telnet mailserver 25 helo root mail from:root rcpt to:email@example.com data Hello . QUIT
To receive status emails from the server, the easiest is to configure /etc/aliases in order to receive mails for root:
# Person who should get root's mail root: firstname.lastname@example.org
To make the new alias effective type the following command: