Status e-mail - nodemailer

1

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

  

messageId: [email protected]

Is it possible to make an appointment to check the status of this email? such as whether it was already opened, whether it was actually received, etc ... I currently use nodemailer in nodejs but I can migrate to any platform / language without problems.

The solution I found was by adding the link or img in the middle of the email and when it is opened would have the confirmation but I think if you can not make a query with this messageid on the mail server.

    
asked by anonymous 27.11.2018 / 20:28

1 answer

1

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

  • Place a hidden image and when the client has the option to view html enabled, from that image that usually comes with a parameter together, you identify that that email has been opened. It may occur that the client is not having the html view enabled and still open your email and you would never be notified.
  • Place a header in the e-mail so that the sender is notified when e-mail is read. Feature famous in the late 90's and early 00's, however, the client can cancel this notification manually.
  • 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 of the plugin when you send the e -mail through

    transporter.sendMail(data, function(callback) {
    
    });
    

    You have access to the callback.info object (enter other attributes) which provides the following variables:

    • messageId : most transports should return the final Message-Id value used with this property (note that should = therefore not guaranteed)
    • envelope : includes the envelope object for the message
    • accepted : is an array returned by SMTP transports (includes recipient addresses that are accepted by the server)
    • rejected : is an array returned by SMTP transports (includes recipients that were rejected by the server)
    • pending : is an array returned by Direct SMTP transport. Includes recipient addresses that are temporarily rejected together with the server response
    30.11.2018 / 23:56