PHP mail() function cannot send to hotmail?

前端 未结 3 896
一向
一向 2020-12-11 07:48

Okay, I have searched on the internet for answers- sadly to no avail. I\'m trying to send mail using the PHP mail() function so members can follow the link to register. It w

相关标签:
3条回答
  • 2020-12-11 08:22

    code likes fine, anything you do that makes it look like spam will block it from hotmail try creating spf records for your domain, and even signatures

    check your mail server is not blacklisted, this can cause problems http://www.mxtoolbox.com/

    As @staticsan recommends php-mailer or also http://swiftmailer.org/ are other options you can use try that might help

    0 讨论(0)
  • 2020-12-11 08:25

    Your code seems to be good. My guess is that there is something wrong at your servers end, check mail delivery logs or have your server admin look at them for you. Could be a routing/dns issue.

    edit: i just tried that script on my server and it works well. immediately got email on my hotmail address.

    0 讨论(0)
  • 2020-12-11 08:47

    You're missing the string "-f <from address>" as the fifth parameter.

    The PHP Manual points out that you need to supply this so that the MTA will send the correct "From" address on the envelope. Setting it in the headers isn't enough. This sort of inanity is why I dis-recommend mail() and point people towards php-mailer or similar.

    (The "envelope" refers to the conversation an MTA has with another MTA in order to deliver email.)

    0 讨论(0)
提交回复
热议问题