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

**URL:** <https://forum.mautic.org/t/error-while-sending-email-mautic-error-mail-error-could-not-send-request-to-server-curl-error-7/29951>\
**Category:** Product Support\
**Created:** [November 15, 2023, 9:52am UTC](https://forum.mautic.org/t/error-while-sending-email-mautic-error-mail-error-could-not-send-request-to-server-curl-error-7/29951 "2023-11-15T09:52:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ramiavi](https://avatars.discourse-cdn.com/v4/letter/r/a88e4f/32.png) [@ramiavi](https://forum.mautic.org/u/ramiavi)\
**Post date:** [November 15, 2023, 9:52am UTC](https://forum.mautic.org/t/error-while-sending-email-mautic-error-mail-error-could-not-send-request-to-server-curl-error-7/29951/1 "2023-11-15T09:52:03Z")

</div>

**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](https://curl.haxx.se/libcurl/c/libcurl-errors.html)) for [https://language-packs.mautic.com/manifest.json](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](mailto: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](https://api.sendgrid.com/v3/mail/send)

please help …

---

<div class="post-metadata">

**Author:** ![EJL](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ejl/32/12155_2.png) [@EJL](https://forum.mautic.org/u/EJL)\
**Post date:** [November 15, 2023, 8:17pm UTC](https://forum.mautic.org/t/error-while-sending-email-mautic-error-mail-error-could-not-send-request-to-server-curl-error-7/29951/2 "2023-11-15T20:17:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![astrylis](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/astrylis/32/6421_2.png) [@astrylis](https://forum.mautic.org/u/astrylis)\
**Post date:** [November 16, 2023, 10:57am UTC](https://forum.mautic.org/t/error-while-sending-email-mautic-error-mail-error-could-not-send-request-to-server-curl-error-7/29951/3 "2023-11-16T10:57:58Z")

</div>

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.
