TransWikia.com

Proper way to use throwaway email addresses for testing

Software Quality Assurance & Testing Asked by Nikhita Jalan on December 13, 2020

I need to use a throwaway email address domain in my test scripts. Currently, we are using mailinator but it blocks users after a certain limit of bulk emails is reached.

Is there any other better way of achieving this?

7 Answers

There are various online solutions the provide you with unlimited email addresses for testing. We are using Mailosaur with Cypress to test our signup and password reset processes.

Answered by anichols on December 13, 2020

I don't get why you need throw away email addresses. Can't you just remove the account and re-use the same email address again in your tests?

I would have a look at Mailtrap, they have a service with which you can catch mails send from your servers without sending them to a real inbox somewhere. Also I think you can create mailboxes, receive and check email content and such with their API.

Answered by Niels van Reijmersdal on December 13, 2020

I use https://www.guerrillamail.com/inbox it has a selection of domains for you to use which gets over the blocking issue.

Answered by P. Johnson on December 13, 2020

Any time you need to test something where the application under test interacts with outside services, you have a couple of choices:

1) Stubbing 2) Use a real service

Then there's a choice between using an internal or external stub or service.

Stubbing is where you build a fake interface, that just does enough for the application under test to be tested. The problem is that for something like SMTP, where you have many, many error conditions and the like, in order to stub properly, you might as well write your own SMTP server. Or you could use one of the many options that come up when you google "stub smtp server."

The second option is using a real SMTP server (or, better, several different SMTP servers). For integration testing, this is the best way to go. This is because standards can be interpreted differently, and you need to make sure that your application works with different interpretations of the standards.

Then you have a choice between managing the service internally, externally for free, or externally for a fee. If you're testing anything you plan to charge for, I would very strongly suggest either hosting the service internally, or externally where you have some sort of contractual agreement with the service. In the case of mailinator, for example, anyone can read mail that has been sent to a given inbox. If your competitors find out that you're using a publicly available, world-readable service to test new products with, there's a chance they will be able to figure out what you're working on.

Answered by Kevin McKenzie on December 13, 2020

I have used a trick with gmail where you can append +string on any address. The string I filled in was a Unix Time Stamp.

Original Email Address: [email protected]

Testing Email Address: [email protected]

Answered by kirbycope on December 13, 2020

For manual testing (ie, visually inspecting the emails), you should use a local SMTP server, like Bhavani. I've used Mailcatcher in the past and really enjoyed it.

Answered by Daniel Serodio on December 13, 2020

I've handled the scenario with the local smtp server setup with the open source tools like hMailserver. After setting up, you can define your own domains and email ids.

Answered by Bhavani on December 13, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP