Ethereal Email – A fake SMTP service
ethereal.email
ethereal.email
Ex: I would create an interface called IMailService with the operations like Send etc, and once my application is ready, just swap the concrete implementation of the MailService class with the one that talks to the real mail service using Dependency Injection.
If it's not for developers, who would use something like this?
For staging environments I like Mailtrap.io because it's a cleaner interface for non-devs.
My bad.
These alerts can go to a user and/or a user's supervisor(s).
Additionally, the content of the message is dynamic.
This service would be very easy to add as a config option and let non-technical coworkers test the application for accuracy.
Also, I will know that SMTP is actually working.
Otherwise, I need to write the code and a UI for the non-technical coworker, and a way to store it. I have other things I need to work on.
But, as you said, it can be iffy, so that is why I want to know if the issue is with stuff I control, or them.
So, at least I know it is being sent and my logic is solid.
After reading a lot's of RFC's, I found it's really helpful to test my code against some standard SMTP server so I can know my code is work as expected.
But a real SMTP server is not an option as they all have some kind of filters and server settings that will interfere my test, + In this case, I don't think doing TDD with a real working commercial server (i.e Gmail, Outlook etc) is a good idea. It's not only slow, but also wasting (their resources).
That's when a fake SMTP server come in handy. Because not only you can use them to Send a lot's of mail, also those emails will not generate any (I hope) real world side effect.
If the same developers write the clients and the mocks, then it's likely that both components implement identical misunderstandings, if there are misunderstandings.
That said, I was giving an example of why a mock might not be an appropriate solution, and not on the wider topic of what "enough" might be.
I can certainly think that testing the ability to send emails to, say, 5,000 different addresses, and check that they are received, might be easier with something like this system.
I came across this when forwarding everything to gmail. Gmail is smart enough to accept this for mail originally destined for an address you enabled as "send from". However, mail sent to e.g. retailName@domain.com will fail the checks and never be delivered.
Our primary application allows us to safely import recent dumps of the production databases into select CI systems, of which some tables have user records with real email addresses for report sending, etc.
In the case that the code which sanitizes these records misfires or otherwise fails to do its job, at least we won't send random emails to actual customers. I know we've all gotten those from a vendor at one time or another and it's a corporate level face-palm that's worth the extra effort to avoid. Belts & suspenders, defense-in-depth, and all that.
“8. How is this sustainable Ethereal Email service is funded by the ads displayed on Nodemailer.com. So don't forget to click on these banners!”
So far my experience has been good. I get to work on some email sending code on a wifi-less airplane.
- Most of us don't know about it
- You have to install postfix