Error while sending email - mautic.ERROR: [MAIL ERROR] Could not send request to server. CURL error 7:

Your software
My Mautic version is: 4.4.10
My PHP version is: 8.0.3
My Database type and version is: 10.5.16-MariaDB

Your problem
My problem is: I cant send emails from the server with sendgrid API
it used to work, i run my server on AWS ec2
it worked when was on basic IP, i updated to static IP and set a domain
now i cant send emails , getting error about CURL
i checked connectivity from the server SSH to sendgrid API url looks OK
test connection in the config screen also work fine
but send email return

These errors are showing in the log:

[2023-11-15 09:34:06] mautic.ERROR: An error occurred while attempting to fetch the language list: cURL error 7: (see libcurl - Error Codes) for https://language-packs.mautic.com/manifest.json {“hostname”:“ip-xxxeu-west-1.compute.internal”,“pid”:883}

[2023-11-15 09:34:31] mautic.ERROR: [MAIL ERROR] Could not send request to server. CURL error 7: (send); xxxx@gmail.com {“exception”:“[object] (SendGrid\Exception\InvalidRequest(code: 7): Could not send request to server. CURL error 7: at /var/www/mautic/vendor/sendgrid/php-http-client/lib/Client.php:507)”} {“hostname”:“ip-xxx.eu-west-1.compute.internal”,“pid”:837}

Steps I have tried to fix the problem:
cleared cache
restart server
check connectivity to https://api.sendgrid.com/v3/mail/send

please help …

Not solution related but I’d sanitize the IP and email address from this inquiry for security sake.

1 Like

Hey ramiavi and welcome to Mautic

I am not sure of your setup but I have a setup for sending from my domain to mailtrap, should be similar. Have you checked that these settings are correct? For example I use cloudflare and I must have these set in order to send emails from my domain

  • CNAME record used to verify the domain
  • SPF record
  • DKIM records (2)
  • DMARC record

** to add

These won’t be on your mautic instance.
I assume you have checked the test connection button on your mautic instance which will test that emails will send etc.