Properly configuring Sendmail can be a real pain. Especially when all you need is to simply get email off of a system and send to remote email addresses. For this, SSMTP may be the solution. For my setup I simply want to send email from my system through Gmail.
SSMTP can be downloaded from here:
or using yum in to install SSMTP:
yum install ssmtp
The configuration file is /etc/ssmtp/ssmtp.conf
Replace AuthUser and AuthPass with your Google Gmail username and password. The username should not have @gmail appended. Also change firstname.lastname@example.org to be the email address which should originate the email.
To make things easier I also setup a separate gmail account which just handles my outbound email from the system. If you use the same gmail account to send and then view the received email; it will never appear in the inbox.
The easiest solution is to create a separate gmail account to originate the email.
Personally, I am using SSMTP to send voicemail messages attached to an email from the Asterisk VoIP System. All I had to change in the Asterisk voicemail.conf file was the following:
My voicemail is then attached to an email as a wave file.