PHPMail not working with gmail

tigrao

New Member
Messages
5
Reaction score
0
Points
1
Hi everyone,

I am under the free host x11.10hosting.com.

I have a website that sends out 2FA codes as well as a forgot password request to the registered email on file.

Everything worked just fine until when I noticed today that the site cannot email GMail. All others are working fine.

I have searched the whole day for a solution and nothing so far.

The PHP script below will send a test message every time the page is refreshed. If I enter a hotmail or yahoo address or any other it works just fine. Gmail however doesn't.


$headers = 'From: <no-reply@mywebsite.comr>' . "\r\n" .
'Reply-To: <no-reply@mywebsite.com>';

mail('<myemail@gmail.com>', 'Test Message', 'the test message', $headers,
'no-reply@mywebsite.com');


Any ideas?

Thanks!
 

tigrao

New Member
Messages
5
Reaction score
0
Points
1
Hi everyone,

I am under the free host x11.10hosting.com.

I have a website that sends out 2FA codes as well as a forgot password request to the registered email on file.

Everything worked just fine until when I noticed today that the site cannot email GMail. All others are working fine.

I have searched the whole day for a solution and nothing so far.

The PHP script below will send a test message every time the page is refreshed. If I enter a hotmail or yahoo address or any other it works just fine. Gmail however doesn't.





Any ideas?

Thanks!

Forgot to mention:

What's interesting about this problem is that from Roundcube mail I can send emails to Gmail.

Thanks!
 

mrburnsx

Community Advocate
Community Support
Messages
377
Reaction score
36
Points
28
Gmail is likely rejecting it due to it being unauthenticated mail by just using mail().

It would take a lot to get it to accomplish that task, but I would recommend using a library like PHPMailer
 

tigrao

New Member
Messages
5
Reaction score
0
Points
1
Gmail is likely rejecting it due to it being unauthenticated mail by just using mail().

It would take a lot to get it to accomplish that task, but I would recommend using a library like PHPMailer
Hi mrburnsx,

Thanks for your reply.

I had it working and it was just fine. Unfortunately phpmailer is not allowed on the free host. Just now I noticed the entire thing went down (cpanel and website). I am hoping they are "rebooting"..

My script works on another test server with a local email account. Not sure what else I can do. If it fixes itself I'll post it here.
 

mrburnsx

Community Advocate
Community Support
Messages
377
Reaction score
36
Points
28
Hi mrburnsx,

Thanks for your reply.

I had it working and it was just fine. Unfortunately phpmailer is not allowed on the free host. Just now I noticed the entire thing went down (cpanel and website). I am hoping they are "rebooting"..

My script works on another test server with a local email account. Not sure what else I can do. If it fixes itself I'll post it here.
PHPMailer is allowed on free hosting. I'm not sure where you got that it is not allowed.
 

tigrao

New Member
Messages
5
Reaction score
0
Points
1
PHPMailer is allowed on free hosting. I'm not sure where you got that it is not allowed.
I have phpmailer on the x11 free host and it is blocked. I do have a domain name btw.

Also: yesterday's outage did not "fix" the issue.

Going to try swiftmailer today
 
Top