We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Email sent out using PHP Mail no longer working...got error when trying SMTP

How Do I?

5BYFIVE Creative's avatar
5BYFIVE Creative
142 posts
9 years ago
5BYFIVE Creative's avatar 5BYFIVE Creative

Email sent automatically from client’s site (like form submissions) using PHP Mail are no longer getting through to them. They had some email issues and it stopped working around the time it got fixed, so I imagine it was something on their end. Anyway, I tried to use SMTP instead for a gmail account and got some errors when I tried to send an email from the control panel…


Unable to send email at this time.

hello: F The following SMTP error was encountered: F Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.


Any ideas? I want to contact their IT people who handle the web hosting, but I’m not sure about what to ask from them. I’ve never had to setup any different outgoing mail system so I’m stuck at the moment. Thanks for any help!

       
Derek Jones's avatar
Derek Jones
7,561 posts
9 years ago
Derek Jones's avatar Derek Jones

Ah, caught this question from you on Slack. Posting here for posterity and searchability. 😊


Derek Jones [2:35 PM] SMTP with gmail is a tricky thing. You have to add some config vars ​and​ you have to create an app-specific password, ​and​ they have pretty tight quantity limits.

Mike Lohrman [2:36 PM] i think I got it worked out with some config variables

​[2:36] still testing though

Derek Jones [2:36 PM] Does this work in a standalone script on the server?

<?php
mail('[email protected]', 'Subject of the email', 'Body of the email');

​[2:36] if it doesn’t, I’d just point their server admins at that script, doesn’t get any more basic than that

​[2:37] If it sends and just isn’t getting delivered, then they likely have local delivery enabled for their own domain on the server and need to turn that off.

Mike Lohrman [2:38 PM] this helped(http://expressionengine.stackexchange.com/questions/333/is-it-possible-to-use-gmail-as-the-smtp-server-for-sending-e-mail-from-expressio), I will also look into the local delivery. I think I’ve had that issue in the past. Unfortunately I don’t have access to the hosting to make things go quicker

Is it possible to use gmail as the smtp server for sending e-mail from ExpressionEngine? Is it possible to use gmail as the smtp server for sending e-mail out from ExpressionEngine? It looks like you need to be able to set a different port and i’m not sure you can do it from the E-mail

Derek Jones [2:39 PM] Yep, @kevinsmith’s answer is spot on(edited)

TJ Draper [2:39 PM] I don’t know if you can trust that dude…

​[2:39] 😉

Mike Lohrman [2:43 PM] Derek, about the app-specific password you mentioned previosuly, is it possible to set one up so EE registers as a “Secure” app and then I can keep “Allow less secure apps” turned OFF?

​[2:43] i turned it ON and things worked, turned it OFF and it stopped working

Derek Jones [2:44 PM] I ​think​ so?

​[2:45] https://security.google.com/settings/security/apppasswords

​[2:45] might only be on Google Apps for Business accounts, not sure

Mike Lohrman [2:47 PM] ok, will do more research

       
5BYFIVE Creative's avatar
5BYFIVE Creative
142 posts
9 years ago
5BYFIVE Creative's avatar 5BYFIVE Creative

For now I think we have this working using the Gmail SMTP. I had to turn “Allow less secure apps” for the Google account to ON, which I’m sure is fine, but might freak the client out, not sure yet. If that doesn’t work out, I think I’ll give Mandrill a try. Thanks!

       
TJ Draper's avatar
TJ Draper
222 posts
9 years ago
TJ Draper's avatar TJ Draper

If you can use Mandrill, they are the best.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.