Setting up Sendgrid as an email relay on your needs backend integration at this moment. You need to login into the server as root over SSH and follow the steps below:
First of all, you need to backup the file /etc/exim4/exim4.conf.template to get this done, use the command below:
cp /etc/exim4/exim4.conf.template /etc/exim4/exim4.conf.template-back
vi /etc/exim4/exim4.conf.template
Under ‘begin authenticators’ Please add the following lines:
Note: username should actually be ‘apikey’, not your sendgrid username
Under ‘begin routers’ Please add the following lines:
send_via_sendgrid:
driver = manualroute
domains = ! +local_domains
transport = sendgrid_smtp
route_list = "* smtp.sendgrid.net::587 byname"
host_find_failed = defer
no_more
Under ‘begin transports’ Please add the following lines:
sendgrid_smtp:
driver = smtp
hosts = smtp.sendgrid.net
hosts_require_tls = <; $host_address
redirect_router = send_via_sendgrid