man5 Posted August 23, 2014 Share Posted August 23, 2014 (edited) Alright so I have 3 pages. Signup, Password reset and Send message. All three pages/forms email to the recipient. So far my test have only been with hotmail and gmail. All emails go through for hotmail accounts. They show up in the hotmail. All emails DO go through for gmail accounts. But they don't show up in the gmail. The only page that gmail is able to receive emails from is "send message". The emails derived from that send message show up in gmail. The other two don't. There are not errors on the server side that show up. It clearly shows emails being sent. Does anyone have a clue why this is happening? Edited August 23, 2014 by man5 Quote Link to comment https://forums.phpfreaks.com/topic/290619-this-is-so-weird-using-phpmailer-i-can-send-emails-to-hotmail-but-not-gmail/ Share on other sites More sharing options...
man5 Posted August 23, 2014 Author Share Posted August 23, 2014 Well I figured out what the problem is. Google is blocking my email from sending to that person. I tried a hotmail email as a sender's email and it did go through. I have a domain and hosted on a server(bluehost). I am using the free email service that comes with it. I guess it would look spamy to google if coming from these free email service, even though it's a real email(info@mydomain.com). Is there an alternative solution to this, as oppose to paying monthly for improved email service? Quote Link to comment https://forums.phpfreaks.com/topic/290619-this-is-so-weird-using-phpmailer-i-can-send-emails-to-hotmail-but-not-gmail/#findComment-1488749 Share on other sites More sharing options...
CroNiX Posted August 23, 2014 Share Posted August 23, 2014 You're sure they're actually going through? It might be successfully sent but gmail might be rejecting it after that. I'd check your mail logs. Quote Link to comment https://forums.phpfreaks.com/topic/290619-this-is-so-weird-using-phpmailer-i-can-send-emails-to-hotmail-but-not-gmail/#findComment-1488750 Share on other sites More sharing options...
CroNiX Posted August 23, 2014 Share Posted August 23, 2014 What reason did they give for blocking? Quote Link to comment https://forums.phpfreaks.com/topic/290619-this-is-so-weird-using-phpmailer-i-can-send-emails-to-hotmail-but-not-gmail/#findComment-1488751 Share on other sites More sharing options...
mac_gyver Posted August 23, 2014 Share Posted August 23, 2014 as a sender's email the emails are being sent FROM your mail server at bluehost. the domain in the from address needs to correspond to the sending mail server, i.e. you have set up dns zone records under your account that the receiving mail server can use to confirm that the sending mail server where your domain is hosted at IS where the mail should have been sent from. if you want to include the sender's email address, for reply purposes, you put it into a Reply-to: mail header, not the From: header. Quote Link to comment https://forums.phpfreaks.com/topic/290619-this-is-so-weird-using-phpmailer-i-can-send-emails-to-hotmail-but-not-gmail/#findComment-1488753 Share on other sites More sharing options...
man5 Posted August 23, 2014 Author Share Posted August 23, 2014 (edited) There is no message from google why they are blocking it. The email simply never shows up, while in hotmail it shows up. I have checked the DNS Zone Editor on bluehost. It list 5 hosts. 4 have the same ip address and local has it's own ip. Here is part of phpmailer $mail->IsSMTP(); // Set mailer to use SMTP $mail->Host = '234.456.789.562'; $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = 'info@mydomain.ca'; // SMTP username $mail->Password = 'pass123'; // SMTP password $mail->From = 'info@mydomain.ca'; $mail->FromName = 'mydomainname'; $mail->AddAddress($recipient_email); Initially I was using the localhost ip(127.0.0.1) for host above and it will still sending emails. Now I switched to the mail ip and it's still sending emails; but again not to gmail I should also mention that on my send_message.php page, a non registered user is sending an message to a registered user's email that's in the database. The member I am testing it on has a gmail account and the email goes through. It's just that on signup and reset password page, that same gmail email won't receive an email. Weird. ps. my domain ends iwth .ca. So it's info@mydomain.ca. Edited August 23, 2014 by man5 Quote Link to comment https://forums.phpfreaks.com/topic/290619-this-is-so-weird-using-phpmailer-i-can-send-emails-to-hotmail-but-not-gmail/#findComment-1488754 Share on other sites More sharing options...
CroNiX Posted August 24, 2014 Share Posted August 24, 2014 When google doesn't accept an email from me they bounce it and I receive it back with the reason why they didn't accept it. Usually they say it "looks spammy". Do you receive bounced emails back to your inbox? Quote Link to comment https://forums.phpfreaks.com/topic/290619-this-is-so-weird-using-phpmailer-i-can-send-emails-to-hotmail-but-not-gmail/#findComment-1488765 Share on other sites More sharing options...
CroNiX Posted August 24, 2014 Share Posted August 24, 2014 If you have access, you should check your mail logs. Quote Link to comment https://forums.phpfreaks.com/topic/290619-this-is-so-weird-using-phpmailer-i-can-send-emails-to-hotmail-but-not-gmail/#findComment-1488766 Share on other sites More sharing options...
man5 Posted August 24, 2014 Author Share Posted August 24, 2014 Well on bluehost there are two kinds of logs. Error logs and access logs. I don't seen any errors regarding mail, except for this. Account has exceeded the max emails per hour allowed, referer: http://swiftfm.com/?p=2121#comment-84388 I doubt that's the issue for why the emails are not going to gmail. I do not receive any bounced back emails from google. They emails are sent perfectly with no error returns. They just never show up in gmail. The issue is definitly the free email service of bluehost. I read somewhere that Google back listed Bluehost. Quote Link to comment https://forums.phpfreaks.com/topic/290619-this-is-so-weird-using-phpmailer-i-can-send-emails-to-hotmail-but-not-gmail/#findComment-1488812 Share on other sites More sharing options...
CroNiX Posted August 24, 2014 Share Posted August 24, 2014 Ah, so you don't have access to the actual mail logs, which is most likely where the bounce notice from gmail would be. It doesn't make sense that gmail is blocking bluehost if you are able to send to gmail from the send_message.php but not your other pages. Presumably these are all being sent via bluehost. We use SendGrid with a unique IP for outbound emails and it works great. You're not at the mercy of your hosts IP reputation. If 500 different domains are sending through Bluehost and some of them are bad/spammy/fishing/etc, it could affect delivery of everybody else. We send about 4,000 emails/day without issue. Once in a few months there will be a problem with a specific domain that we can get resolved directly, but google will be NO help to you unless you have a business account. They'll just point you to about 10 huge webpages of info and tell you to make sure your emails are in compliance with their rules. Here's some good info: http://www.rackaid.com/blog/gmail-blacklist-removal/ Quote Link to comment https://forums.phpfreaks.com/topic/290619-this-is-so-weird-using-phpmailer-i-can-send-emails-to-hotmail-but-not-gmail/#findComment-1488813 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.