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

前端 未结 12 2122
盖世英雄少女心
盖世英雄少女心 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:12

    Delivery Status Notification is the usual way: http://www.sendmail.org/~ca/email/dsn.html

    You can't tell if an email is read unless you use that microsoft email thing and the reader has not disabled read receipts.

    Edit: I haven't progressed to HTML email yet so I never considered that for a read notification.

    0 讨论(0)
  • 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!

    0 讨论(0)
  • 2020-12-09 22:16

    A web bug might give you something like a read receipt, if that's what you're asking.

    0 讨论(0)
  • 2020-12-09 22:18

    Unfortunately, there's no 100% method for determining if a message was delivered to the user's inbox. Even if the server accepts the message, it could get snagged by spam filters or bounced back asynchronously.

    A lot of people have mentioned web bug tracking style techniques. These work well for marketing people: they can make assumptions based on sample size. They require HTML emails and that the user loads images in the HTML. This happens automatically in some cases, but a lot of the time people must specifically click a 'download images' button.

    Another method is to use Goodmail. Part of their service is tracking which messages actually get delivered and opened. Of course, it costs money and not all mail providers are supported. Again, it's mostly a marketing tool.

    You could also have tracking scripts hidden in links. For example, you create a URL that looks like:

    http://trackingserver/track/$messageid/http://real.url/goes/here
    

    The track script then records a 'click' in the database and redirects the client to http://real.url/goes/here. You then need to have a compelling reason to click that URL every time.

    0 讨论(0)
  • 2020-12-09 22:20

    The SMTP protocol is asynchronous, so the only guaranteed feedback can be returned by the users mail client. In case there are problems with the delivery you will get back bounce emails to the address defined in the envelope sender (mail header Return-Path) Timing of these bounces are unpredictable and undefined. Tracking pixels in the HTML email body are so far the best way to report you that the user has actually opened the email.

    0 讨论(0)
  • 2020-12-09 22:22

    All the tracking links and webbugs assume that people actually open the email and enable remote images, or click links. Which is all flawed.

    To make sure if an email is received and not returned, I'd do the following:

    1. Add Errors-To header (set to e.g. bounce@domain.com)
    2. Add Return-Path header (set to e.g. bounce@domain.com)
    3. Pick up the email box (bounce@domain.com) and parse the emails

    This lets you check when an email came back, based on the message content you can probably figure out which one bounced/came back.

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