Status e-mail - nodemailer

Asked

Viewed 323 times

1

Whenever I send a message using nodemailer I have how to get the example messageid :

messageid: [email protected]

It is possible to make a query to check the status of this email ? as if it has already been opened, if it has actually been received, etc... I currently use nodemailer in nodejs but can migrate to any platform / language without problems.

The solution I found was adding the link or img in the middle of the email and when it was opened I would have confirmation but I wonder if there is no way to make a query with this messageid in the mail server.

1 answer

1

First of all, it is important for you to know that it is impossible to find out if a user has opened a sent email because the SMTP protocol does not provide a way for us to identify this action. What we can do, is put some "triggers" inside the email to try to help us know when this occurred (I’ll cite some cases you specified in your doubt as well):

  1. Place a hidden image and when the client has the option to view html enabled, from this image that usually comes with a parameter together, you identify that that email has been opened. It may occur that the client is not with the html view enabled and still open your email and you would never be notified.
  2. Place a header in the email so that the sender is notified when e-mail is read. Feature famous in the late 90’s and early 00’s, however, customer can cancel this notification manually.
  3. Send a link in the email, forcing the client to enter the url to read the message (much like the idea of option 1)

To increase your email functionality, you can consult the documentation plugin, when you send the email through the

transporter.sendMail(data, function(callback) {

});

you have access to the callback.info object (enters other attributes) that provides the following variables:

  • messageid: Most Transports should Return the final Message-Id value used with this Property (note that should = should therefore not be guaranteed either)
  • envelope: includes the envelope Object for the message
  • accepted: is an array returned by SMTP Transports (includes recipient Addresses that Were accepted by the server)
  • Rejected: is an array returned by SMTP Transports (includes recipient Addresses that Were Rejected by the server)
  • pending: is an array returned by Direct SMTP transport. Includes recipient Addresses that Were temporarily Rejected Together with the server Response
  • 1

    Because we are on a site that follows the Portuguese language, I imagine it would be prudent for you to translate the passages in English into Portuguese.

  • I accepted as an answer! Thank you.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.