# Upgrade to 5.1 - SendGrid not working

**URL:** <https://forum.mautic.org/t/upgrade-to-5-1-sendgrid-not-working/32486>\
**Category:** Product Support\
**Created:** [June 21, 2024, 8:00pm UTC](https://forum.mautic.org/t/upgrade-to-5-1-sendgrid-not-working/32486 "2024-06-21T20:00:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![c-speed](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/c-speed/32/12621_2.png) [@c-speed](https://forum.mautic.org/u/c-speed)\
**Post date:** [June 21, 2024, 8:00pm UTC](https://forum.mautic.org/t/upgrade-to-5-1-sendgrid-not-working/32486/1 "2024-06-21T20:00:16Z")

</div>

**Your software**  
My Mautic version is: 5.1  
My PHP version is: 8.2  
My Database type and version is: Mysql 8.0

**Your problem**  
My problem is:

Hello, I upgrade from 3.2.5 to 5.1 today. The upgrade went smoothly and is working. I am now trying to get SendGrid configured. Installed SendGrid with:

composer require symfony/sendgrid-mailer

There were no errors during the install.

 ![Screenshot 2024-06-21 at 1.02.33 PM](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/a/a6fd94bf1bdfc6100cdf2ccb13aa9a375fa165e8.jpeg)

**These errors are showing in the log:**

In mautic email settings, I set the Scheme to: sendgrid:api and the User to my API key but when I save, it has an error “The mailer DNS must contain a host (use “default” by default).”

And it says “Using currently DSN: n/a”

 ![Screenshot 2024-06-21 at 12.50.06 PM](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/2/2099c31174325a6b0db836948c090a9d10f7d204.png)

**Steps I have tried to fix the problem:**

I looked in the .env file and there’s nothing there for Send Grid:

 ![Screenshot 2024-06-21 at 1.00.53 PM](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/6/68e9bf4b2e82defbdc4f7b6c8058a109a879a048.png)

I added the following line with no success:

MAILER\_DSN=sendgrid+api://MY\_API\_KEY@default

I’ve tried clearing the cache with no success.

Thanks.

---

<div class="post-metadata">

**Author:** ![c-speed](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/c-speed/32/12621_2.png) [@c-speed](https://forum.mautic.org/u/c-speed)\
**Post date:** [June 22, 2024, 5:18pm UTC](https://forum.mautic.org/t/upgrade-to-5-1-sendgrid-not-working/32486/2 "2024-06-22T17:18:39Z")

</div>

UPDATE: I finally resolved the issue. For how good Mautic is, I want to preface this with the fact that the Mautic + SendGrid integration documentation is extremely poor.

1. You must install SendGrid via composer:

composer require symfony/sendgrid-mailer

1. You must configure the Email DSN as follows:

Scheme: sendgrid+api  
Host: [api.sendgrid.com](http://api.sendgrid.com)  
Port: Leave Blank  
Path: Leave Blank  
User: Your SendGrip API key  
Password: Leave Blank

 ![Screenshot 2024-06-22 at 10.11.23 AM](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/9/9143a91a152df024b69d4a2447e5625f2672c5e7.png)

I hope this helps prevent other people from wasting hours of their time.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/1X/43c63600fe51440378769136903f1fa2a9a34102.png) [@system](https://forum.mautic.org/u/system)\
**Post date:** [June 24, 2024, 5:19am UTC](https://forum.mautic.org/t/upgrade-to-5-1-sendgrid-not-working/32486/3 "2024-06-24T05:19:22Z")

</div>

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.
