Sendgrid is a transactional mail service used for sending email from application servers as an SMTP relay. The current method of sending email is to use nullmailer.
Nullmailer must be installed on any server sending email to Sendgrid.
apt-get install nullmailer
In /etc/nullmailer/remotes:
smtp.sendgrid.net smtp --port=587 --user=apikey --pass=<SENDGRID_API_KEY>
The API key can be found in the Sendgrid control panel under Settings → API keys
In /etc/nullmailer/adminaddr:
Add MM's domains:
echo "mountainmeasurement.com.com" | tee /etc/nullmailer/defaultdomain
echo "mountainmeasurement.com" | tee /etc/nullmailer/defaultdomain
Restart nullmailer:
systemctl restart nullmailer
Send a test email:
echo "This is a test email" | mail -s "Test Email" [email protected]