2

I use a very basic and simple mail() php function to automatically send email to the new users so that they can activate their account, which looks like this:

    $body = "Thank you for your registering at ". BASE_URL. ". To activate your account, please click on this link:\n\n";
    $body .= BASE_URL . 'activate.php?e=' . urlencode($e) . "&a=$a";
    mail($trimmed['email'], 'Registration Confirmation', $body, 'From: admin@hiteachers.com');  

In which the $trimmed['email'] is the email the new user uses to enter the website registration form after validation, and the admin@hiteachers.com is my REAL email address, which I use with Google apps (I followed the link https://support.google.com/a/answer/33353?hl=en (#2,3 and 4) to edit the MX records in my domain manager).

Note : - I bought the domain and a shared linux server at Godaddy.

  • I also consulted PHP mail() function cannot send to hotmail?, and some other related links, but it didn't help.

  • I also followed the link https://mail.live.com/mail/troubleshooting.aspx to troubleshoot the SMTP Non-Delivery Report by adding hiteachers.com IN TXT "v=spf1 -all" into the TXT records and waited for 48 hours, but no luck!

  • I also added the TXT value v=spf1 a mx -all into my domain TXT records as per other stackoverflow users' suggestions, and waited for 48 hours, but no luck!

  • I also added the from email address to the safe contact list of the recipient addresses at @hotmail.com, and @outlook.com, which i used for testing, but no luck!

  • No email has been sent to @hotmail or @outlook inbox, even in the junk folder, and no bouce-back email either (because the recipient accounts are real).

  • It works well with real gmail and yahoo email recipient addresses.

  • I tried sending email directly from admin@hiteachers.com to the real recipient email address at outlook.com, it stayed there in the inbox (means that it accepts my admin@hiteachers.com address). However, when I viewed the message source, it says This sender failed our fraud detection checks and may not be who they appear to be.

Do you know what was wrong with it, or have you ever been in the same situation as mine? And the important part of my question is what I should do to eliminate the whole issue, please?

UPDATED

After adding the SPF and other required records, which you can take a look at here http://mxtoolbox.com/ for the domain hiteachers.com, I received the report from <email>noreply-dmarc-support@google.com</email> like this, and all my testing auto-email to @yahoo.com and @gmail.com are going to spam folders, but not the inbox before:

<?xml version="1.0" encoding="UTF-8" ?>
<feedback>
  <report_metadata>
    <org_name>google.com</org_name>
    <email>noreply-dmarc-support@google.com</email>
    <extra_contact_info>https://support.google.com/a/answer/2466580</extra_contact_info>
    <report_id>10844434555482221094</report_id>
    <date_range>
      <begin>1458172800</begin>
      <end>1458259199</end>
</date_range>
  </report_metadata>
  <policy_published>
    <domain>hiteachers.com</domain>
    <adkim>r</adkim>
    <aspf>r</aspf>
    <p>quarantine</p>
    <sp>quarantine</sp>
    <pct>100</pct>
  </policy_published>
  <record>
    <row>
      <count>1</count>
      <policy_evaluated>
        <disposition>quarantine</disposition>
        <dkim>fail</dkim>
        <spf>fail</spf>
      </policy_evaluated>
    </row>
    <identifiers>
      <header_from>hiteachers.com</header_from>
    </identifiers>
    <auth_results>
      <spf>
        <domain>xxxxxxxxx.xxx.xxx.xxxx.secureserver.net</domain>
        <result>none</result>
      </spf>
    </auth_results>
  </record>
</feedback>
Community
  • 1
  • 1
Phong
  • 85
  • 5
  • Try this structure [here](http://stackoverflow.com/a/34107379/5455207) – Virtua Creative Mar 16 '16 at 04:39
  • which OS you were using ? If linux try this command and check once: sudo apt-get install sendmail Just assuming – Ranzit Mar 16 '16 at 04:43
  • Why is your SPF record empty? – tadman Mar 16 '16 at 04:49
  • @tadman: You can take a look at my SPF records here `http://mxtoolbox.com/SuperTool.aspx?action=mx%3ahiteachers.com&run=toolpage#` and also the MX records, DKIM records, and **dmarc** too. – Phong Mar 18 '16 at 13:08
  • The new issue just arisen now is that all auto-emails to the testing **yahoo.com* and **gmail.com** are going spam folders. I just received the report from `noreply-dmarc-support@google.com`, which I added in the **UPDATED**. can you help? – Phong Mar 18 '16 at 13:21
  • Anyone can help with my case? thanks – Phong Mar 19 '16 at 02:46
  • Your setup only fits for *Gmail for Work*, *Google Apps for Work* or *Google Apps free (legacy)*. If you don't use those products as a mail gateway, then your setup is wrong. If you only want to send mails locally without Google beeing your Gateway, then your setup is wrong. The way you want to route your mails is not clear to me. – Daniel W. Mar 21 '16 at 13:52
  • Hi all, it works for me now after altering the SPF records from `v=spf1 include:_spf.google.com ~all` to `v=spf1 a include:_spf.google.com ~all` – Phong Mar 25 '16 at 01:54
  • You still have something set up wrong, all you did was change it from `v=spf1 a mx -all` to `v=spf1 a ~all` the `include:_spf.google.com` is pointless, since you're not using gmail to send with in this instance. So what I think happened is you went from "Fail" to "SoftFail" by changing the `-` to `~` . You should test you SPF using [mailtest](https://www.unlocktheinbox.com/resources/emailauthentication/) to make sure you're not really failing SPF, I have a feeling you still are. – Henry Apr 06 '16 at 23:46
  • @henry : all outgoing emails to `@hotmail.com` and `@outlook.com` are successful, though it's still going into their Junk boxes anyway. To me, it's still better than NONE as before. The `mailtest` you suggested is not free anyway! – Phong Apr 07 '16 at 03:38
  • @Phong - Since it's going to junk mail in hotmail, can you post the headers from hotmail, it has a anti-spam line that tells you why it's being filtered into junk. Also some basic tests are free in mailtest like DKIM, SPF, ETC and they have a summary on top that gives you an idea of how many issues you might have. The ability to send mail is priceless in my opinion. – Henry Apr 07 '16 at 13:52

0 Answers0