Is there a way to determine whether an e-mail reaches its destination?

前端 未结 12 2266
盖世英雄少女心
盖世英雄少女心 2020-12-09 21:40

I have a PHP script that sends out critical e-mails that needs to reach its destination. I know how to check whether the e-mail sent successfully, the only issue is knowing

12条回答
  •  天命终不由人
    2020-12-09 22:14

    Try this:

    Write the email with HTML (it's not that tricky with PHP). In that email, include one picture (maybe just a pretty logo or something). This picture will be a special picture... it's src will be, say, myserver.com/images/logo.gif?recipient@email.com. This src will need to be dynamically generated for each person who is sent the email. Then, if the recipient opens the email, the email client will ask your server for logo.gif?recipient@email.com

    So, if your server recieves a request for that image, you'll know that recipient@email.com received your message.

    You can create a special format for the tag at the end of the URL, so that it would not only tell which person it is, but which email they're responding to.

    Keep in mind, this is what spammers do to tell if an email address is active. So, certain software may ask the user if they think you're spam! Also, some users won't have image support (or will have this support turned off).

    Good luck!

提交回复
热议问题