• Home

Mailinator For Testing – new API to Fetch Links

Mailinator has always been an excellent tool for testing your system’s emails. It allows customers to instantly have an infinite number of Private Inboxes which they can access via Web, API, or via Mailinator’s Rule System. One of the primary use cases for that is the “click the links” in those emails to close the loop with your test. That might be confirming an email for sign-up or hitting the reset-password link.

In the fully programmatic sense, Mailinator’s Rule System will do that for you. Simply set up an inbox in your Private Domain where every link gets automatically clicked by the Mailinator system. However, if you have a need to do this on your system, we’ve added a new API call to just grab the links from any email.

It looks like:

https://mailinator.com/api/v2/domains/<your-private-domain>/inboxes/<any-inbox>/messages/<msg-id>/links

The API will return all the links parsed from the email. From there, your code can click them or process them however you choose.

{
    "links": [
        "https://www.abc.com/link2",
        "https://www.xyz.com/link1"
    ]
}

You can, of course, fetch attachments the same way with:

https://mailinator.com/api/v2/domains/<your-private-domain>/inboxes/<any-inbox>/messages/<msg-id>/attachments
https://mailinator.com/api/v2/domains/<your-private-domain>/inboxes/<any-inbox>/messages/<msg-id>/attachments/<attachment-id>

We’re always adding new features to the system, keep an eye here for further updates!

Thanks for being a Mailinator customer!