I have been tearing my hair out for the last 2 days on this and I really need some help. This is my first time working with Magento 2 and GoDaddy (I have a lot of experience with M1 and dedicated hosting). I didn't set up email sending functionality on any of my M1 installs (it was built in and worked or their IT guys handled it), so this is all new territory for me and I'm not getting it.

Here's the setup:

  • Magento OS 2.2.4
  • GoDaddy Grow Business hosting (their recommended platform for Magento, short of VPS or dedicated servers)
  • Business email through Google
  • No GoDaddy emails configured
  • 1 GoDaddy cPanel email configured as a test, in addition to the default cPanel email for the main login
  • Website (www.crostwater.com) is currently under development and IP whitelisted. Anyone NOT on the list gets redirected to our static "Coming Soon" page
  • I added GoDaddy's email server IPs to the .htaccess
    • RewriteCond %{REMOTE_ADDR} !^198\.71\.24[4-7]
    • RewriteCond %{REMOTE_ADDR} !^198\.71\.25[3-5]

Out of the box, email works. But because Magento uses PHPMailer to send the messages, emails received by customers show our-cpanel-user@foo.bar.secureserver.net...very unprofessional. After much Googling, I've determined that PHP's mail function isn't incredibly versatile in terms of customizing the sender. You can add the "-f" param to include a sender email, but to do that I have to put in a custom PHP.ini setting for the sendmail_path. I've heard you can set headers, but I can't figure out an easy way to tap into Magento's mail functions and insert headers so the emails contain an intelligible name/reply email. Further, it shouldn't be hard coded (like my php.ini configuration change) because you can indicate who the 'sender' is for any given email from Magento. So the sender information needs to be dynamic and use the Magento configuration in order to work properly.

I have also learned in my searching that GoDaddy blocks you from using Google's SMTP servers to send mail when you're on a shared platform, which I guess is what the 'Grow Business' is. You are supposed to be able to use their SMTP servers, but nothing works. I've tried installing 2 different SMTP extensions, one from Mageplaza and one from Magepal. Both had exactly the same problems.

First, if I try to use Gmail's SMTP, I get an error that it can't open socket.

GoDaddy has configuration info in the cPanel for how to use SMTP. According to what it says, I should use crostwater.com as the host and port 465 for secure (it doesn't say if it should be SSL or TLS, but neither work). With those settings I get 'unable to open socket' or 'connection refused' I have tried with the default cPanel email, my custom no-reply@ email I set up in the cPanel, as well as a GSuite address set up for our business through Google. None of these work.

If I try port 587 and TLS, Magento errors out on the cert validation because the expected crostwater.com domain doesn't match the *.foo.bar.secureserver.net domain on the cert. I found info about this online and hacked a core file to ignore the cert check. This allows the email to go through, but only if I'm testing using the extension's test functionality. No transactional emails go through with this.

Even more Googling revealed that there is (or used to be) different ways to get this done. I've tried using relay-hosting.secureserver.net, I've tried my-cpanel-email.foo.bar.secureserver.net, all fail. I even found that, depending on where you look in the GoDaddy cPanel, even THEY recommend 2 different things. On one page it tells me that for the default email I should use the username that matches my cPanel login (without the domain). On another page it said I should use _mainaccount@crostwater.com as the login. Neither of these work, but the lack of consistency really concerns me.

I was on a call with GoDaddy for a while working through this and he thought it should be working, yet it wasn't. He claimed it was because I didn't have an HTTPS redirect in my .htaccess to force all visitors over to HTTPS. I put that in place but still got nowhere.

I honestly have no idea why this is so hard. I hope I'm doing something wrong, because this should not be this challenging. The thought of needing a 3rd party extension just to send email from my eCommerce site in a way that looks somewhat professional is mind boggling...but lots of what Magento decides to do ends up in that category.

So what's going on here? Did I do something stupid? How do I get this set up?

  • 1
    I won't comment on GoDaddy for Magento, other than I wouldn't use it. As for email setup, I use Gmail for Business, that way I use the Gmail servers, and github.com/magepal/magento2-gmail-smtp-app for setup in Magento. Much less hassle and many less order and tracking emails going to the customer's spam folders. – dawhoo Jun 28 '18 at 19:11
  • 1
    Yeah, it's a little late in the game to switch hosts, but that may be in the cards in the near future. Live and learn I guess :( – BrianVPS Jun 29 '18 at 13:38
  • Could be worse for sure, but moving to another server company hasn't been as bad as it would seem in my experience. I've moved several stores without too much hassle. Most hosting companies will do it for you with ssh, but not sure if GoDaddy allows that? – dawhoo Jul 10 '18 at 19:34
  • @BrianVPS have you solved it? – Dima Portenko Oct 21 '19 at 13:16
  • No, sadly, I never did. We ended up switching hosts to InMotion, and then managing Magento became too cumbersome for the company and they decided to drop the e-comm side alltogether and went with a more WYSIWYG site editor. I'm no longer working with Magento 2, though I am sure I will in the future. At that time I hope this issue is solvable. – BrianVPS Oct 21 '19 at 17:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.