Ssmpt is a light weight mail package that is easy to configure and suitable for my needs during local development. It is basically a mail forwarder, can’t receive email, and has very few settings relative to a program like sendmail.
Comcast is notorious for requiring email sent on its network to go through its smtp server. Not doing that can get your IP blacklisted and your legitimate emails flagged as spam. I resisted but was assimilated. These settings should work for most ISPs, not just Comcast.
sudo apt-get install ssmtp
Configure ssmpt for Comcast:
You must setup an account with our ISP / email provider and enter the email/password below. I use a dedicated email account for development.
sudo vi /etc/ssmtp/ssmtp.conf
root=postmaster mailhub=smtp.comcast.net:587 UseSTARTTLS=YES UseTLS=YES AuthUserfirstname.lastname@example.org AuthPass=**** hostname=mymachine FromLineOverride=YES
To test it out:
First save a test message in the ssmtp format, here is how my file looks:
$ cat testmessage.txt To: email@example.com From: firstname.lastname@example.org Subject: test message Test message for ssmtp.
To send the message:
ssmtp email@example.com < testmessage.txt
For PHP compatibility:
Edit php.ini, look for the sendmail section, set the following:
sendmail_path = /usr/sbin/ssmtp -t
Last step: restart apache