Not receiving email from the PHP mail() method

后端 未结 3 661
太阳男子
太阳男子 2020-12-18 06:48

I have tried to set-up an email.html and an action.php so that someone can send an email from a website. Here is the code in email.html

相关标签:
3条回答
  • 2020-12-18 07:18

    First check result of the mail. You also should check the php error log file.

    when your mail is really going out, use an valid sender email, the you can get bounces from the receiving mail server.

    don't forget, there are many anti spam technology's. most important is that you respect and know how SPF is working. that's one of the most fails, websites doesn't send emails which don't arrive at recipient.

    0 讨论(0)
  • 2020-12-18 07:21

    Well, banged my head hard.. Just to realise they were going in Spam folder of my "$to" email id. Also check this on your side.

    0 讨论(0)
  • 2020-12-18 07:23

    Start by checking the return value of mail to see if the message is being accepted by your SMTP server.

    Also, per Namecheap's documentation, your From address is invalid.

    Only domains that are hosted on our servers can be used in 'From' field. Any domain that is not hosted with us cannot be added to 'From' field. We had to take this measure to prevent sending spam using forums, guest books and contact forms scripts. For your site scripts to work properly you should set 'From' field to email account that has been created in your cPanel.

    Even if this were allowed by your hosting company, you shouldn't be sending mail from @gmail.com using non-Gmail servers anyway. It will often be blocked by SPF and other such anti-spam measures on the receiving end.

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