Sending email by google smtp from my laravel website not working after transfer site to cloudflare

On my local Laravel application , my website works fine and emails are been sent from my website using google smtp to do this. Now, after transfer domain to cloudflare , sending of email from my google smtp mail stopped working , making my application not to function properly. Any suggestion on how to solve this email not working proplem ? my domain is bull-stock .com

You have 2 SPF records, but you can have only one.

You want to remove the record that does not have google in it.

1 Like

Sending via Google / Gmail shouldn’t be ruined by this change, even if you’re doing one or more mistakes along the way of moving your domain to Cloudflare DNS.

Are you actually seeing any error codes or messages while trying to send messages?

As for inbound way (e.g. receiving messages sent towards your domain name), you’re missing the MX record(s) for Google / Gmail, assuming that Google / Gmail is also supposed to handle your inbound messages as well.

DNS records can be added/modified/deleted over here:

https://dash.cloudflare.com/?to=/:account/:zone/dns/records

1 Like

Yes, i just removed the other one now. And still does not work. i am getting the error from my laravel application when it tries to send a mail. This is the error: Connection could not be established with host “ssl://smtp.gmail.com:465”: stream_socket_client(): Peer certificate CN=s85.gocheapweb.com' did not match expected CN=smtp.gmail.com`

Yes, i am getting the error from my laravel application when it tries to send a mail. This is the error: Connection could not be established with host “ssl://smtp.gmail.com:465”: stream_socket_client(): Peer certificate CN=s85.gocheapweb.com’ did not match expected CN=smtp.gmail.com`

This specific part indicates that you are attempting to connect to smtp.gmail.com, using a secure connection on port 465, which would be the correct way for Google / Gmail.

This one seems like your web server (e.g. the machine running your laravel application) is somehow hijacking / intercepting outbound email traffic, preventing the access to the Google / Gmail SMTP.

If you do not operate that server, and that e.g. gocheapweb.com is your hosting provider, I would contact them, first of all to ask them why they are intercepting your outbound email messages, but also to ask how you can eventually remediate the issue together.

2 Likes

Please note that first of all i bought the hosting from hostblast.online and bought the domain from namesilo . So i did a transfer of domain to hostblast , after wards i transferred the domain to Cloudflare. Can did affect the email not working ? I have had previous jobs where i bought both domain and hosting from the same hosting company and everything works fine , with the email and all. Now just because i purchased them separately , i do not know if this is what is causing the issue…???

gocheapweb.com appears to be another domain belonging to hostblast.online.

So yes, you would need to contact Hostblast, as it is their set up that is preventing you from using any other third party SMTP servers in their current configuration.

There is another identical situation with some WHM/cPanel hosting being mentioned here:

If you’re not operating the server on your own, which it doesn’t sound like, the only option you have would be to contact Hostblast.

If they are unable to lift the restriction, or otherwise help you with alternatives that you can accept, you might have to look in to alternatives, such as e.g. another hosting provider, if this kind of set up (e.g. the parts with the email sending) is crucial to you.

2 Likes

Hello, i contacted the hostblast support and they replied with this :

Thank you for contacting us!

This is not an issue of the Hostblast server. Since your DNS is hosted with Cloudflare, you must configure the correct “MX” RECORD to point email traffic to the email provider. Often this problem happens due to errors in your DNS configurations. There are no DNS entries required within cPanel because your DNS is not managed by us. Please contact the person responsible for your nameservers and request that they update the DNS record to fix this issue. Also, you need to configure the correct SMTP records on your script according to your email provider too.

Note

  • Please turn off the Proxy for the webmail.
  • If you want to point the email to the hostblast server please use the records below.

A - 178.32.154.97
MX - s85.gocheapweb.com

Kind regards,

Kimberly A. Mayes
HostBlast Support

What do i have to do now ?

I obviously don’t know what you wrote in your message to them, but the reply completely ignores everything that @DarkDeviL explained in his previous post. You can just ignore that email, it doesn’t help you in any way.

cPanel has an option called “SMTP Restrictions”. This is not something that you can change, only the host can add you to the exceptions list.

This is very likely what’s preventing you from sending emails, and I think it is unlikely they will allow you to bypass this.

To be fair, this is not an unreasonable restriction for a very cheap shared hosting platform to prevent spam, though it should be documented somewhere.

The only option to send email is probably to use their local email server, but that probably only work if they are also your domain registrar.
I’d just find another host instead of trying to make things work there if I was you.

https://hostblast.myorderbox.com/kb/node/365

I’m a fan of using transactional email service providers with HTTPS API access, such as Mailgun, Postmark, or other comparable services.

1 Like

I’m using google SMTP… any work around ???

Yes. Switch to a transactional email service with an HTTPS API like I suggested. It is a far more appropriate and versatile solution.

1 Like

Yes I understand, but these other Email services are “paid for” and that was why I went for the google SMTP service which is free . Do you have any suggestions of other services I can use that are free ?

I use paid Mailgun, but a web :search: will show that some providers have a free tier, including Postmark that I mentioned.

free tier transactional email service providers - Brave Search

Understood , but i am using a laravel application where mail services avalibale are via SMTP, Mailgun, Postmark, Amazon SES, and sendmail

Maybe try Postmark.

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.