# 500 Internal Server Error \[MAIL ERROR\] Connection could not be established with host :stream\_socket\_client():

**URL:** <https://forum.mautic.org/t/500-internal-server-error-mail-error-connection-could-not-be-established-with-host-stream-socket-client/25389>\
**Category:** Product Support\
**Tags:** mautic-4\
**Created:** [September 14, 2022, 9:07pm UTC](https://forum.mautic.org/t/500-internal-server-error-mail-error-connection-could-not-be-established-with-host-stream-socket-client/25389 "2022-09-14T21:07:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![yahyahassan](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/yahyahassan/32/8271_2.png) [@yahyahassan](https://forum.mautic.org/u/yahyahassan)\
**Post date:** [September 14, 2022, 9:07pm UTC](https://forum.mautic.org/t/500-internal-server-error-mail-error-connection-could-not-be-established-with-host-stream-socket-client/25389/1 "2022-09-14T21:07:09Z")

</div>

**Your software**  
My Mautic version is: v4.1.2  
My PHP version is: 7.4.30  
My Database type and version is: 10.3.34-MariaDB-0ubuntu0.20.04.1

**Your problem**  
My problem is: **500** Internal Server Error

These errors are showing in the log:

[2022-09-14 13:10:06] mautic.ERROR: [MAIL ERROR] Connection could not be established with host :stream\_socket\_client(): php\_network\_getaddresses: getaddrinfo failed: Name or service not known Log data: ++ Starting Swift\_Transport\_EsmtpTransport !! Connection could not be established with host :stream\_socket\_client(): php\_network\_getaddresses: getaddrinfo failed: Name or service not known (code: 0) (send); [admin@icomco.co](mailto:admin@icomco.co) {“exception”:“[object] (Swift\_TransportException(code: 0): Connection could not be established with host :stream\_socket\_client(): php\_network\_getaddresses: getaddrinfo failed: Name or service not known\nLog data:\n++ Starting Swift\_Transport\_EsmtpTransport\n!! Connection could not be established with host :stream\_socket\_client(): php\_network\_getaddresses: getaddrinfo failed: Name or service not known (code: 0) at /home/icomco.co/public\_html/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Plugins/LoggerPlugin.php:124)”}

[2022-09-14 22:37:38] mautic.NOTICE: PHP Notice - Undefined offset: 1 - in file /home/icomco.co/public\_html/app/bundles/EmailBundle/Helper/MailHelper.php - at line 1964 {“idHash”:null,“monitoredEmail”:false,“settings”:{“address”:“”,“host”:“[mail.icomco.co](http://mail.icomco.co)”,“port”:“993”,“encryption”:“/ssl/novalidate-cert”,“user”:"admin@icomco.co",“password”:“1K4tyIetmN@eECb+”,“use\_attachments”:“”,“folder”:“”},“email”:“”}

[2022-09-14 22:37:38] mautic.CRITICAL: Uncaught PHP Exception Swift\_RfcComplianceException: “Address set in PathHeader does not comply with addr-spec of RFC 2822.” at /home/icomco.co/public\_html/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/icomco.co/public\_html/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/PathHeader.php:150)”}

Steps I have tried to fix the problem:
