# Only PHP Mail is working...

**URL:** <https://forum.mautic.org/t/only-php-mail-is-working/6457>\
**Category:** Product Support\
**Created:** [November 5, 2016, 10:44pm UTC](https://forum.mautic.org/t/only-php-mail-is-working/6457 "2016-11-05T22:44:32Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![jharri](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jharri](https://forum.mautic.org/u/jharri)\
**Post date:** [November 5, 2016, 10:44pm UTC](https://forum.mautic.org/t/only-php-mail-is-working/6457/1 "2016-11-05T22:44:32Z")

</div>

I have a copy of Mautic installed on my server - out of the box - no configuration changes… I can’t get any other type of mail configured - Sendgrid, Amazon, Other SMTP…only PHP Mail is working. Is there a setting or something i am missing to be able to use the other services? I checked with my host and they are not restricting ports…  
  
  
  
Sendgrid Error:  
  
Connection could not be established with host [smtp.sendgrid.net](http://smtp.sendgrid.net) [Connection timed out #110] Log data: ++ Starting Swift\_SmtpTransport !! Connection could not be established with host [smtp.sendgrid.net](http://smtp.sendgrid.net) [Connection timed out #110] (code: 0)  
  
++ Starting Swift\_SmtpTransport !! Connection could not be established with host [smtp.sendgrid.net](http://smtp.sendgrid.net) [Connection timed out #110] (code: 0)  
  
  
  
  
  
Amazon Error:  
  
Connection could not be established with host [email-smtp.us-west-2.amazonaws.com](http://email-smtp.us-west-2.amazonaws.com) [Connection timed out #110] Log data: ++ Starting MauticEmailBundleSwiftmailerTransportAmazonTransport !! Connection could not be established with host [email-smtp.us-west-2.amazonaws.com](http://email-smtp.us-west-2.amazonaws.com) [Connection timed out #110] (code: 0)  
  
++ Starting MauticEmailBundleSwiftmailerTransportAmazonTransport  
  
  
  
  
  
Thanks,  
  
Jim

---

<div class="post-metadata">

**Author:** ![jharri](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jharri](https://forum.mautic.org/u/jharri)\
**Post date:** [November 5, 2016, 10:44pm UTC](https://forum.mautic.org/t/only-php-mail-is-working/6457/2 "2016-11-05T22:44:32Z")

</div>

I have a copy of Mautic installed on my server - out of the box - no configuration changes… I can’t get any other type of mail configured - Sendgrid, Amazon, Other SMTP…only PHP Mail is working. Is there a setting or something i am missing to be able to use the other services? I checked with my host and they are not restricting ports…

Sendgrid Error:  
Connection could not be established with host [smtp.sendgrid.net](http://smtp.sendgrid.net) [Connection timed out #110] Log data: ++ Starting Swift\_SmtpTransport !! Connection could not be established with host [smtp.sendgrid.net](http://smtp.sendgrid.net) [Connection timed out #110] (code: 0)  
++ Starting Swift\_SmtpTransport !! Connection could not be established with host [smtp.sendgrid.net](http://smtp.sendgrid.net) [Connection timed out #110] (code: 0)

Amazon Error:  
Connection could not be established with host [email-smtp.us-west-2.amazonaws.com](http://email-smtp.us-west-2.amazonaws.com) [Connection timed out #110] Log data: ++ Starting MauticEmailBundleSwiftmailerTransportAmazonTransport !! Connection could not be established with host [email-smtp.us-west-2.amazonaws.com](http://email-smtp.us-west-2.amazonaws.com) [Connection timed out #110] (code: 0)  
++ Starting MauticEmailBundleSwiftmailerTransportAmazonTransport

Thanks,  
Jim

---

<div class="post-metadata">

**Author:** ![jharri](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jharri](https://forum.mautic.org/u/jharri)\
**Post date:** [November 7, 2016, 6:10am UTC](https://forum.mautic.org/t/only-php-mail-is-working/6457/3 "2016-11-07T06:10:38Z")

</div>

Here are the logs when I try to configure Amazon and Sendgrid. Can someone please HELP???

[2016-11-07 05:50:59] mautic.ERROR: PHP Error: Call to undefined method setApiKey - in file /home/bizmds/mautic.bizmds.com/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php - at line 291 [] []  
[2016-11-07 05:51:29] mautic.ERROR: Warning: stream\_socket\_client(): unable to connect to tcp://smtp.sendgrid.net:587 (Connection timed out) - in file /home/bizmds/mautic.bizmds.com/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php - at line 267 [] []  
[2016-11-07 05:53:04] mautic.ERROR: Deprecation: The alias option of the form.type\_extension tag of service “fos\_rest.form.extension.csrf\_disable” is deprecated since version 2.8 and will be removed in 3.0. Use the extended\_type option instead. - in file /home/bizmds/mautic.bizmds.com/vendor/symfony/framework-bundle/DependencyInjection/Compiler/FormPass.php - at line 67 [] []  
[2016-11-07 05:53:29] mautic.ERROR: PHP Error: Call to undefined method setApiKey - in file /home/bizmds/mautic.bizmds.com/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php - at line 291 [] []  
[2016-11-07 05:53:59] mautic.ERROR: Warning: stream\_socket\_client(): unable to connect to tcp://smtp.sendgrid.net:587 (Connection timed out) - in file /home/bizmds/mautic.bizmds.com/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php - at line 267 [] []  
[2016-11-07 05:56:00] mautic.ERROR: PHP Error: Call to undefined method setApiKey - in file /home/bizmds/mautic.bizmds.com/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php - at line 291 [] []  
[2016-11-07 05:56:30] mautic.ERROR: Warning: stream\_socket\_client(): unable to connect to tcp://smtp.sendgrid.net:587 (Connection timed out) - in file /home/bizmds/mautic.bizmds.com/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php - at line 267 [] []  
[2016-11-07 05:58:53] mautic.ERROR: Deprecation: The alias option of the form.type\_extension tag of service “fos\_rest.form.extension.csrf\_disable” is deprecated since version 2.8 and will be removed in 3.0. Use the extended\_type option instead. - in file /home/bizmds/mautic.bizmds.com/vendor/symfony/framework-bundle/DependencyInjection/Compiler/FormPass.php - at line 67 [] []  
[2016-11-07 05:58:58] mautic.ERROR: PHP Error: Call to undefined method setApiKey - in file /home/bizmds/mautic.bizmds.com/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php - at line 291 [] []  
[2016-11-07 05:59:28] mautic.ERROR: Warning: stream\_socket\_client(): unable to connect to tcp://email-smtp.us-west-2.amazonaws.com:587 (Connection timed out) - in file /home/bizmds/mautic.bizmds.com/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php - at line 267 [] []

---

<div class="post-metadata">

**Author:** ![Antonio\_Lazzari](https://avatars.discourse-cdn.com/v4/letter/a/e99b99/32.png) [@Antonio\_Lazzari](https://forum.mautic.org/u/Antonio_Lazzari)\
**Post date:** [December 17, 2016, 1:21pm UTC](https://forum.mautic.org/t/only-php-mail-is-working/6457/4 "2016-12-17T13:21:08Z")

</div>

I have the same error do you solve it?

---

<div class="post-metadata">

**Author:** ![denispavliha](https://avatars.discourse-cdn.com/v4/letter/d/e0b2c6/32.png) [@denispavliha](https://forum.mautic.org/u/denispavliha)\
**Post date:** [December 17, 2016, 1:33pm UTC](https://forum.mautic.org/t/only-php-mail-is-working/6457/5 "2016-12-17T13:33:23Z")

</div>

Can you ping those mailservers from the shell of your VPS?  
Does the DNS resolve them to proper IPs?  
Can you telnet to them from the shell of the VPS (to appropriate ports, of course)?

---

<div class="post-metadata">

**Author:** ![jptejela](https://avatars.discourse-cdn.com/v4/letter/j/5f9b8f/32.png) [@jptejela](https://forum.mautic.org/u/jptejela)\
**Post date:** [February 9, 2017, 8:59pm UTC](https://forum.mautic.org/t/only-php-mail-is-working/6457/6 "2017-02-09T20:59:16Z")

</div>

I have the same problem with 2.6.0 and telnet to the mailserver is working properly.

Any update?

---

<div class="post-metadata">

**Author:** ![bchiam](https://avatars.discourse-cdn.com/v4/letter/b/bcef8e/32.png) [@bchiam](https://forum.mautic.org/u/bchiam)\
**Post date:** [February 12, 2017, 4:41pm UTC](https://forum.mautic.org/t/only-php-mail-is-working/6457/7 "2017-02-12T16:41:02Z")

</div>

First make sure your webhost firewall does not block the smtp port you are using. Then ensure the setting from your smtp server are configure correctly.

I using Elasticemail smtp, so far so good.

---

<div class="post-metadata">

**Author:** ![mbednarczyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mbednarczyk/32/6_2.png) [@mbednarczyk](https://forum.mautic.org/u/mbednarczyk)\
**Post date:** [February 15, 2017, 11:48am UTC](https://forum.mautic.org/t/only-php-mail-is-working/6457/8 "2017-02-15T11:48:18Z")

</div>

There is a fix for this issue here: [https://github.com/mautic/mautic/pull/3440/files](https://github.com/mautic/mautic/pull/3440/files) - give it a whirl 🙂

Ruth

---

<div class="post-metadata">

**Author:** ![jharri](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jharri](https://forum.mautic.org/u/jharri)\
**Post date:** [August 2, 2017, 7:27am UTC](https://forum.mautic.org/t/only-php-mail-is-working/6457/9 "2017-08-02T07:27:00Z")

</div>

I switched hosting providers and it worked fine after that…strange.
