By default, Mautic offers built-in support for several mail transports, including SMTP and SendGrid. However, if you prefer more direct control using Symfony’s Mailer component, you can install the symfony/sendgrid-mailer
package and configure Mautic to use sendgrid+api as the transport. This guide shows you how.
SSH into your server, navigate to your Mautic folder (often/var/www/mautic
), and run:
cd /var/www/mautic
sudo -u www-data composer require symfony/sendgrid-mailer:*
This ensures all new packages are installed with the correct file ownership (www-data
). You’ll now havesymfony/sendgrid-mailer
in your Mautic project.
Name it something like Mautic and give it Full Access to Mail Send.
Tip: You must set up domain authentication (SPF, DKIM and DMARC) in SendGrid’s “Sender Authentication” section.
Tip: Disable SendGrid's built in Click and Open tracking. It can break links generated by Mautic's click tracking.
These can be found in Settings > Tracking in your SendGrid dashboard.
sendgrid+api
In Configuration > Email Settings > Email DSN, set Scheme to “sendgrid+api”, Host to “default”, Port, Path and Password should be empty, and the User field should contain your API key set up in step 2.
php bin/console cache:clear
This approach gives you maximum flexibility, leveraging Symfony Mailer’s sendgrid+api transport instead of traditional SMTP or Mautic’s built-in integration. Now, you can enjoy the reliability and analytics of SendGrid’s API alongside Mautic 5’s robust marketing automation platform.
Article Number: 231
Author: Apr 4, 2025
Last Updated: Apr 4, 2025
Author: GEM [[email protected]]
Online URL: https://kb.mautic.org/article/how-to-use-the-sendgrid-api-in-mautic-5-with-symfony-mailer.html