Configure Sendmail with Sendgrid for SmartHost Mail Relay
Set the authorization credentials in /etc/mail/access
Define the Smart Host in /etc/mail/sendmail.mc. You should add these lines just after the commented
line in the file. In Ubuntu these would be the last lines added to the file.
AuthInfo:smtp.sendgrid.net "U:apikey" "P:" "M:PLAIN"Define the Smart Host in /etc/mail/sendmail.mc. You should add these lines just after the commented
\#dnl define('SMART_HOST', 'smtp.your.provider')dnlline in the file. In Ubuntu these would be the last lines added to the file.
define(`SMART_HOST', `smtp.sendgrid.net')dnl
FEATURE(`access_db')dnl
define(`RELAY_MAILER_ARGS', `TCP $h 587')dnl
define(`ESMTP_MAILER_ARGS', `TCP $h 587')dnl