Mailosaur logo
Mailosaur logo

Replying to email

Use the reply function to simulate a user replying to one of your emails.

Available with any of the following plans, except where noted:

Business, Professional and Enterprise

If your product is capable of handling email replies from your customers, you can use Mailosaur’s reply feature to simulate such a scenario.

When you reply, the email is obviously sent back to the email address it was originally sent to Mailosaur from. Before you can reply, you must first add this address as a verified external email address.

Replying to a test email
A hashtag icon

You can reply to emails within the Mailosaur Dashboard, or via the API:

  1. Open one of your emails within the Mailosaur Dashboard.
  2. Click the Reply button, at the top of the screen.
  3. Enter the message body for the reply (Note: this field supports Markdown syntax.)
  4. When you are finished, click Send.

Attachments
A hashtag icon

You can include attachments in replies requested via the API, by including an array of base64-encoded attachment objects:

const attachments = [{
  fileName: 'cat.png',
  contentType: 'image/png',
  content: '{BASE64_ENCODED_FILE}'
}];

await mailosaur.messages.reply('{MESSAGE_ID}', {
  html: '<p>Hello world.</p>',
  attachments: attachments
});

The content property of an attachment should be the base64-encoded content of the file you want to attach. Here’s an example of how to base64-encode a file:

const fs = require('fs');

// ...

const buffer = fs.readFileSync('/path/to/file.txt');
const content = buffer.toString('base64');