Today I’m really excited to announce the release of Nodemailer v4.1.0. If you have everything already set up regarding email sending then you probably do not care too much about this release. If you are currently building something or plan to build an app that, amongst other things, sends email, then this new release might interest you.
Nodemailer v4.1.0 includes 2 new API methods
where the first one generates an actually working email account out of the blue and the other one returns extra information about a delivery.
These autogenerated accounts are not too real though, these are test accounts from Ethereal.email mail testing service.
When an Ethereal test account is used then Nodemailer establishes a normal SMTP connection against Ethereal SMTP server, authenticates with actual credentials and the server accepts message for delivery, so nothing unusual about it. What is a bit unusual though is that the Ethereal server never does the actual delivery, it stores the message to the account of the authenticated user and that’s it. You don’t have to worry about unexpected deliveries where mail is delivered to actual recipients. Ethereal never sends any messages.
getTestMessageUrl(info) method returns a web URL that can be used to preview the sent message in a browser. You can preview the message HTML, download the RFC822 source of the message or just check the message headers.
You can store the autogenerated credentials and start using these as development credentials instead of spamming a real email account. Or if you do not want to then you can generate fresh credentials for every new test email, it’s your own choice. If you want to use IMAP to preview the sent messages then you probably want to use pre-generated credentials, otherwise it wouldn’t make much sense.