MailSlurps dashboard and API offer numerous ways to filter and extract content and attachments from emails.

You can also use MailSlurp to find patterns in email contents and extract text matches for later use. Examples might be testing user sign up verification processes or customized transactional emails.

Extracting content

You can use the email controller method to extract matching text from an email.

You can use MailSlurp in any language using official SDKs or in the online web app.

Matching for email fields

Say we send a verification email with a code we want to extract:

We can use methods to extract the code.

Match definitions

Here are the fields and options that can be used when matching emails:

Use the method on the EmailController to parse emails and extract HTML links.

If you have trouble with matches try asserting the content of the email using the less strict methods.

More examples

Find more source code in our examples section or the guides page