# Error 500 sending email

**URL:** <https://forum.mautic.org/t/error-500-sending-email/16644>\
**Category:** Product Support\
**Created:** [October 19, 2020, 8:55pm UTC](https://forum.mautic.org/t/error-500-sending-email/16644 "2020-10-19T20:55:33Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![izojunior](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/izojunior/32/3704_2.png) [@izojunior](https://forum.mautic.org/u/izojunior)\
**Post date:** [October 19, 2020, 8:55pm UTC](https://forum.mautic.org/t/error-500-sending-email/16644/1 "2020-10-19T20:55:33Z")

</div>

**Software**  
My Mautic version is: 3.1.1  
My PHP version is: 7.3.23

**Problem**  
I will configure SMTP correctly. I performed the connection test successfully, but when sending the test email, Mautic presented error 500. What can that be?

**Log**  
[2020-10-19 17:43:17] mautic.CRITICAL: Uncaught PHP Exception Swift\_RfcComplianceException: “Address set in PathHeader does not comply with addr-spec of RFC 2822.” at /home/simuleonline/public\_html/crm/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/PathHeader.php line 150 {“exception”:"[object] (Swift\_RfcComplianceException(code: 0): Address set in PathHeader does not comply with addr-spec of RFC 2822. at /home/simuleonline/public\_html/crm/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/PathHeader.php:150)"}

 ![Captura de Tela 2020-10-19 às 17.54.34](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/a/a94089c5f3ca9882109d59608e56bf10e4ab0ab5.png)

---

<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:** [October 19, 2020, 9:45pm UTC](https://forum.mautic.org/t/error-500-sending-email/16644/2 "2020-10-19T21:45:35Z")

</div>

> [@izojunior](#):
>
> RFC 2822.

the error states there are invalid characters in the email address or it is not formatted as xxxxx@xxxxxx.xxx

---

<div class="post-metadata">

**Author:** ![izojunior](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/izojunior/32/3704_2.png) [@izojunior](https://forum.mautic.org/u/izojunior)\
**Post date:** [October 19, 2020, 9:56pm UTC](https://forum.mautic.org/t/error-500-sending-email/16644/3 "2020-10-19T21:56:59Z")

</div>

Hi, I checked the configuration and it seems to be correct, see:

 ![Screenshot_20201019-185417_Chrome](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/0/08b1866d101ba8de3d2853cc2a9e7ba019164042.jpeg)

---

<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:** [October 19, 2020, 10:32pm UTC](https://forum.mautic.org/t/error-500-sending-email/16644/4 "2020-10-19T22:32:08Z")

</div>

> [@izojunior](#):
>
> ![Screenshot_20201019-185417_Chrome](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/0/08b1866d101ba8de3d2853cc2a9e7ba019164042.jpeg)

Try removing the email address from the first line that says **Name to send mail as** and replace it with a name. Also make sure there is not a space at the end of the email

---

<div class="post-metadata">

**Author:** ![izojunior](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/izojunior/32/3704_2.png) [@izojunior](https://forum.mautic.org/u/izojunior)\
**Post date:** [October 19, 2020, 10:45pm UTC](https://forum.mautic.org/t/error-500-sending-email/16644/5 "2020-10-19T22:45:02Z")

</div>

> [@EJL](#):
>
> Try removing the email address from the first line that says **Name to send mail as** and replace it with a name. Also make sure there is not a space at the end of the email

I had changed the name to test, but I went back to the default configuration and the problem persists. The connection is established but Mautic is unable to send the email. See:

 ![Screenshot_20201019-193738_Chrome](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/7/7b81e5ee11bfa798fcf602c45571526dcc20edb7.jpeg)

---

<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:** [October 19, 2020, 10:49pm UTC](https://forum.mautic.org/t/error-500-sending-email/16644/6 "2020-10-19T22:49:56Z")

</div>

The test connection results are irrelevant to the problem you are having. It uses the credentials entered at the bottom of that screen. When attempting to send Swift cannot validate your email as compliant with the naming conventions adopted within RFC 2882.

Did you check to make sure there was no space before or after your email address on line two: **Email address to send mail from** Sounds crazy but it happens. It triggers this exact error as well.

---

<div class="post-metadata">

**Author:** ![izojunior](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/izojunior/32/3704_2.png) [@izojunior](https://forum.mautic.org/u/izojunior)\
**Post date:** [October 19, 2020, 11:27pm UTC](https://forum.mautic.org/t/error-500-sending-email/16644/7 "2020-10-19T23:27:05Z")

</div>

the username and password were correct, I even did another test with a new email account and the problem persists. See:

 ![Screenshot_20201019-202346_Chrome](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/3/333b2dddf52cba0123c83db359130a255cdcf519.jpeg)

---

<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:** [October 19, 2020, 11:31pm UTC](https://forum.mautic.org/t/error-500-sending-email/16644/8 "2020-10-19T23:31:14Z")

</div>

Are you hitting apply changes in the top right of your screen when you make these changes? You have port 587 listed but encryption type **none**. That combo would not typically show successful when you push test connection.

---

<div class="post-metadata">

**Author:** ![izojunior](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/izojunior/32/3704_2.png) [@izojunior](https://forum.mautic.org/u/izojunior)\
**Post date:** [October 20, 2020, 11:57am UTC](https://forum.mautic.org/t/error-500-sending-email/16644/9 "2020-10-20T11:57:13Z")

</div>

My email server support indicates not to put encryption. See (portuguese):

 ![Captura de Tela 2020-10-20 às 08.56.13](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/9/9fe792a519704ff9bcfe8ee92c2d1b7afb567451.png)
