# Can't Connect Sendgrid API to Mautic 5.0.3

**URL:** <https://forum.mautic.org/t/cant-connect-sendgrid-api-to-mautic-5-0-3/32570>\
**Category:** Mautic 5 Install/Upgrade Support\
**Created:** [June 27, 2024, 6:04pm UTC](https://forum.mautic.org/t/cant-connect-sendgrid-api-to-mautic-5-0-3/32570 "2024-06-27T18:04:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![imankitshah](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/imankitshah/32/691_2.png) [@imankitshah](https://forum.mautic.org/u/imankitshah)\
**Post date:** [June 27, 2024, 6:04pm UTC](https://forum.mautic.org/t/cant-connect-sendgrid-api-to-mautic-5-0-3/32570/1 "2024-06-27T18:04:05Z")

</div>

**Your software**  
My Mautic version is: 5.0.3  
My PHP version is: PHP Version 8.1.2  
My Database type and version is: MySQL80

**Your problem**  
My problem is: I’m not able connect Sendgrid api with Mautic.

These errors are showing in the log: I have tried all the possible ways now I’m doubting the setting I have done. Here is the screenshot.

 ![Configuration _ Mautic (2)](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/b/b7be9a6c18d28f883fe8e0e63d0af72c8ee54cd6.png)

---

<div class="post-metadata">

**Author:** ![malik](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/malik/32/433_2.png) [@malik](https://forum.mautic.org/u/malik)\
**Post date:** [June 28, 2024, 8:36am UTC](https://forum.mautic.org/t/cant-connect-sendgrid-api-to-mautic-5-0-3/32570/2 "2024-06-28T08:36:44Z")

</div>

I faced the same issue, tried a bunch of things & finally got it, try this

 ![SendGrid SMTP](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/b/b5836503ccc517e777b20e885459c966b0ce4ac1.png)

Scheme: smtp  
Host: [smtp.sendgrid.net](http://smtp.sendgrid.net)  
Port: 25  
User: apikey  
Password: YOUR PRIVATE API KEY (edited)

---

<div class="post-metadata">

**Author:** ![alexrm1x](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/alexrm1x/32/2500_2.png) [@alexrm1x](https://forum.mautic.org/u/alexrm1x)\
**Post date:** [August 29, 2024, 1:19pm UTC](https://forum.mautic.org/t/cant-connect-sendgrid-api-to-mautic-5-0-3/32570/3 "2024-08-29T13:19:48Z")

</div>

Have in mind that FROM WHICH DIRECTORY you run the “composer” command from is EXTREMELY important and can ruin your mautic installation.

You must position (cd) on the root path mautic folder or directory where the install is, meaning that if you use the “mautic” user on Debian 12 as example…:

/home/mautic/public\_html  
(mautic install dir)

and this is the apache public one:  
/home/mautic/public\_html/docroot

(mautic public pages, this is where you point the apache DocumentRoot both in the apache config file:  
DocumentRoot /home/mautic/public\_html/docroot  
and  
\<Directory /home/mautic/public\_html/docroot\>).

In case you ran “composer” the command from the wrong directory, you can clean the worng install and try the new one:

cd /wrongdirectory  
composer remove symfony/sendgrid-mailer

then go to the right one in my case:  
cd /home/mautic/public\_html  
and run  
composer require symfony/sendgrid-mailer

that will allow you to put “sendgrid+api” and the KEY as the official documentation.

Hope this helps.
