Can't Connect Sendgrid API to Mautic 5.0.3

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.

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

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

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.