php mail() -> junk, sometimes not even received?

前端 未结 2 1849
臣服心动
臣服心动 2021-01-13 23:59

I am using phps mail() function to send confirmation e-mails.

The e-mails get received on gmail and others as far as I\'m aware, the only real problems I\'ve had is

相关标签:
2条回答
  • 2021-01-14 00:50

    Using PHPMailer, or swiftmailer or any other library won't increase your delivery rates in most cases: the most likely culprit is your server set up.

    Sending email successfully is notoriously difficult, have a read here: http://www.codinghorror.com/blog/2010/04/so-youd-like-to-send-some-email-through-code.html for a basic overview of what's necessary.

    Yahoo in particular really wants DKIM set up, and if your ISP hasn't done this for you, or you are on a VPS, can be a real pain.

    Sucessfully sending email takes quite a bit more then simply not being on blacklists. The default of many ISPs it so assume you are SPAM until you have things set up that would make them think otherwise. Guilty until proven innocent.

    In the codinghorror post, take note of this passage:

    Port25 offers a really nifty public service -- you can send email to check-auth@verifier.port25.com and it will reply to the from: address with an extensive diagnostic!

    I had to use an alternate address for the test to work; check-auth2@verifier.port25.com. You can read the details of why to test with each address here: http://www.port25.com/domainkeys/

    In the long run, if you're sending transactional email (ie. not mass mailings but email in response to a user action) I recommend a service like postmark (postmarkapp.com) because at 1/10th of a cent per email, you get all the ugly taken care of for you.

    0 讨论(0)
  • 2021-01-14 01:04

    php mail() function is not a perfect thing to use. Many a times, google/yahoo or some other email providers block the addresses of your hosting, as a result the mail never reached in the destination (so, not in the junk box also). Sometimes, you might face that you sent to two email addresses in different domain (say, gmail and hotmail), one got delivered, other not. So mail() function, though is very simple and easy to use, not suitable always if you want reliable email delivery.

    To me, best thing is to use smtp server of your hosting or any gmail address if your hosting support FSOCKOPEN.

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