Messages
Inspect captured emails
Interactions with messages
Get email message by ID.
Pass the API token in the Api-Token
Unique account ID
3229Unique inbox ID
4015Unique message ID
427Returns email message with its attributes.
Returns unauthorized error message. Check your credentials.
Returns forbidden error message. Check your permissions.
Returns not found error message
Delete message from inbox.
Pass the API token in the Api-Token
Unique account ID
3229Unique inbox ID
4015Unique message ID
427Returns attributes of the deleted message.
Returns unauthorized error message. Check your credentials.
Returns forbidden error message. Check your permissions.
Returns not found error message
Update message attributes (right now only the is_read attribute is available for modification).
Pass the API token in the Api-Token
Unique account ID
3229Unique inbox ID
4015Unique message ID
427Returns attributes of the updated message.
Returns unauthorized error message. Check your credentials.
Returns forbidden error message. Check your permissions.
Returns not found error message
Get all messages in the inbox. The response contains up to 30 messages. Use last_id or page to retrieve more.
Pass the API token in the Api-Token
Unique account ID
3229Unique inbox ID
4015Search query string. Matches subject, to_email, and to_name.
welcomeIf specified, a page of records before last_id is returned. Overrides page if both are given.
123Page number for paginated results.
5lists messages
Returns unauthorized error message. Check your credentials.
Returns forbidden error message. Check your permissions.
Forward message to an email address. The email address must be confirmed by the recipient in advance.
Pass the API token in the Api-Token
Unique account ID
3229Unique inbox ID
4015Unique message ID
427[email protected]Returns confirmation about forwarding.
Returns unauthorized error message. Check your credentials.
Returns forbidden error message. Check your permissions.
Returns not found error message
Get a brief spam report by message ID.
Pass the API token in the Api-Token
Unique account ID
3229Unique inbox ID
4015Unique message ID
427Returns message spam analysis report.
Returns unauthorized error message. Check your credentials.
Returns forbidden error message. Check your permissions.
Returns not found error message
Get a brief HTML report by message ID.
Pass the API token in the Api-Token
Unique account ID
3229Unique inbox ID
4015Unique message ID
427Returns message HTML analysis report.
Returns unauthorized error message. Check your credentials.
Returns forbidden error message. Check your permissions.
Returns not found error message
Get text email body, if it exists.
Pass the API token in the Api-Token
Unique account ID
3229Unique inbox ID
4015Unique message ID
427Returns message body in txt format.
Congrats for sending test email with Mailtrap! Inspect it using the tabs above and learn how this email can be improved. Now send your email using our fake SMTP server and integration of your choice! Good luck! Hope it works.Returns unauthorized error message. Check your credentials.
Returns forbidden error message. Check your permissions.
Returns not found error message
Returns conflict error message. Text body does not exist.
Get raw email body.
Pass the API token in the Api-Token
Unique account ID
3229Unique inbox ID
4015Unique message ID
427Returns raw message body.
From: Magic Elves <[email protected]> To: Mailtrap Inbox <[email protected]> Subject: You are awesome! Content-Type: multipart/alternative; boundary="boundary-string" --boundary-string Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Congrats for sending test email with Mailtrap! Inspect it using the tabs above and learn how this email can be improved. Now send your email using our fake SMTP server and integration of your choice! Good luck! Hope it works. --boundary-string Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline <!doctype html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body style="font-family: sans-serif;"> <div style="display: block; margin: auto; max-width: 600px;" class="main"> <h1 style="font-size: 18px; font-weight: bold; margin-top: 20px"> Congrats for sending test email with Mailtrap! </h1> <p>Inspect it using the tabs you see above and learn how this email can be improved.</p> <img alt="Inspect with Tabs" src="https://assets-examples.mailtrap.io/integration-examples/welcome.png" style="width: 100%;" > <p>Now send your email using our fake SMTP server and integration of your choice!</p> <p>Good luck! Hope it works.</p> </div> <!-- Example of invalid for email html/css, will be detected by Mailtrap: --> <style> .main { background-color: white; } a:hover { border-left-width: 1em; min-height: 2em; } </style> </body> </html> --boundary-string--Returns unauthorized error message. Check your credentials.
Returns forbidden error message. Check your permissions.
Returns not found error message
Returns conflict error message. Raw body does not exist.
Get HTML source of email.
Pass the API token in the Api-Token
Unique account ID
3229Unique inbox ID
4015Unique message ID
427Returns HTML source of a message.
<!doctype html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body style="font-family: sans-serif;"> <div style="display: block; margin: auto; max-width: 600px;" class="main"> <h1 style="font-size: 18px; font-weight: bold; margin-top: 20px">Congrats for sending test email with Mailtrap!</h1> <p>Inspect it using the tabs you see above and learn how this email can be improved. </p> <img alt="Inspect with Tabs" src="https://assets-examples.mailtrap.io/integration-examples/welcome.png" style="width: 100%;"> <p>Now send your email using our fake SMTP server and integration of your choice! </p> <p>Good luck! Hope it works.</p> </div> <!-- Example of invalid for email html/css, will be detected by Mailtrap: --> <style> .main { background-color: white; } a:hover { border-left-width: 1em; min-height: 2em; } </style> </body> </html>Returns unauthorized error message. Check your credentials.
Returns forbidden error message. Check your permissions.
Returns not found error message
Returns conflict error message. HTML source does not exist.
Get formatted HTML email body. Not applicable for plain text emails.
Pass the API token in the Api-Token
Unique account ID
3229Unique inbox ID
4015Unique message ID
427Returns message body in html format.
<!doctype html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body style="font-family: sans-serif;"> <div style="display: block; margin: auto; max-width: 600px;" class="main"> <h1 style="font-size: 18px; font-weight: bold; margin-top: 20px">Congrats for sending test email with Mailtrap!</h1> <p>Inspect it using the tabs you see above and learn how this email can be improved. </p> <img alt="Inspect with Tabs" src="https://assets-examples.mailtrap.io/integration-examples/welcome.png" style="width: 100%;"> <p>Now send your email using our fake SMTP server and integration of your choice! </p> <p>Good luck! Hope it works.</p> </div> <!-- Example of invalid for email html/css, will be detected by Mailtrap: --> <style> .main { background-color: white; } a:hover { border-left-width: 1em; min-height: 2em; } </style> </body> </html>Returns unauthorized error message. Check your credentials.
Returns forbidden error message. Check your permissions.
Returns not found error message
Returns conflict error message. HTML source does not exist.
Get email message in .eml format.
Pass the API token in the Api-Token
Unique account ID
3229Unique inbox ID
4015Unique message ID
427Returns .eml of the message.
From: Magic Elves <[email protected]> To: Mailtrap Inbox <[email protected]> Subject: You are awesome! Content-Type: multipart/alternative; boundary="boundary-string" --boundary-string Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Congrats for sending test email with Mailtrap! Inspect it using the tabs above and learn how this email can be improved. Now send your email using our fake SMTP server and integration of your choice! Good luck! Hope it works. --boundary-string Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline <!doctype html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body style="font-family: sans-serif;"> <div style="display: block; margin: auto; max-width: 600px;" class="main"> <h1 style="font-size: 18px; font-weight: bold; margin-top: 20px"> Congrats for sending test email with Mailtrap! </h1> <p>Inspect it using the tabs you see above and learn how this email can be improved.</p> <img alt="Inspect with Tabs" src="https://assets-examples.mailtrap.io/integration-examples/welcome.png" style="width: 100%;" > <p>Now send your email using our fake SMTP server and integration of your choice!</p> <p>Good luck! Hope it works.</p> </div> <!-- Example of invalid for email html/css, will be detected by Mailtrap: --> <style> .main { background-color: white; } a:hover { border-left-width: 1em; min-height: 2em; } </style> </body> </html> --boundary-string--Returns unauthorized error message. Check your credentials.
Returns forbidden error message. Check your permissions.
Returns not found error message
Returns conflict error message. .eml body does not exist.
Get mail headers of a message
Pass the API token in the Api-Token
Unique account ID
3229Unique inbox ID
4015Unique message ID
427Returns mail headers of the message
Returns unauthorized error message. Check your credentials.
Returns forbidden error message. Check your permissions.
Returns not found error message
Last updated
Was this helpful?

