This is a script to send mail with local ip in it
Use this libraries
sudo apt-get install mailutils mpack
Use this library too
sudo apt-get install ssmtp
link : http://doc.ubuntu-fr.org/ssmtp
to use the following command : /usr/sbin/sendmail
Configure the SSMTP library :
sudo nano /etc/ssmtp/ssmtp.conf
There must be this in the file :
[email protected] #here your mail
mailhub=smtp.gmail.com:587
hostname=srvweb
AuthUser= [email protected] #here your mail
AuthPass=mybeautifulPassWd #here your passwd
FromLineOverride=YES
UseSTARTTLS=YES