const attachments = [{
fileName: 'cat.png',
contentType: 'image/png',
content: '{BASE64_ENCODED_FILE}'
}];
await mailosaur.messages.create('{SERVER_ID}', {
to: 'someone@example.com',
subject: 'Email from Mailosaur',
html: '<p>Hello world.</p>',
send: true,
attachments: attachments
});
const attachments = [{
fileName: 'cat.png',
contentType: 'image/png',
content: '{BASE64_ENCODED_FILE}'
}];
cy.mailosaurCreateMessage('{SERVER_ID}', {
to: 'someone@example.com',
subject: 'Email from Mailosaur',
html: '<p>Hello world.</p>',
send: true,
attachments: attachments
});
attachment = Attachment()
attachment.file_name = "cat.png"
attachment.content_type = "image/png"
attachment.content = "{BASE64_ENCODED_FILE}"
attachments = [attachment]
recipient = "someone@example.com"
subject = "Email from Mailosaur"
body = "<p>Hello world.</p>"
options = MessageCreateOptions(
recipient,
True,
subject,
html=body,
attachments=attachments
)
mailosaur.messages.create("{SERVER_ID}", options)
Attachment attachment = new Attachment();
attachment.withFileName("cat.png");
attachment.withContentType("image/png");
attachment.withContent("{BASE64_ENCODED_FILE}");
MessageCreateOptions options = new MessageCreateOptions();
options.withTo("someone@example.com")
.withSubject("Email from Mailosaur")
.withHtml("<p>Hello world.</p>")
.withSend(true)
.withAttachments(Arrays.asList(new Attachment[] { attachment }));
mailosaur.messages().create("{SERVER_ID}", options);
var attachment = new Attachment()
{
FileName = "cat.png",
ContentType = "image/png",
Content = "{BASE64_ENCODED_FILE}"
};
mailosaur.Messages.Create("{SERVER_ID}", new MessageCreateOptions() {
To = "someone@example.com",
Subject = "Email from Mailosaur",
Html = "<p>Hello world.</p>",
Send = true,
Attachments = new List<Attachment>() { attachment }
}
);
attachment = Mailosaur::Models::Attachment.new()
attachment.file_name = 'cat.png'
attachment.content_type = 'image/png'
attachment.content = '{BASE64_ENCODED_FILE}'
options = Mailosaur::Models::MessageCreateOptions.new()
options.to = 'someone@example.com'
options.subject = 'Email from Mailosaur'
options.html = '<p>Hello world.</p>'
options.send = true
options.attachments = [attachment]
mailosaur.messages.create('{SERVER_ID}', options)
$attachment = new Attachment((object)[
"fileName" => "cat.png",
"contentType" => "image/png",
"content" => "{BASE64_ENCODED_FILE}"
]);
$options = new MessageCreateOptions();
$options->to = 'someone@example.com';
$options->subject = 'Email from Mailosaur';
$options->html = '<p>Hello world.</p>';
$options->send = TRUE;
$options->attachments = [$attachment];
$mailosaur->messages->create('{SERVER_ID}', $options);
var attachment = Attachment{
FileName: "cat.png",
ContentType: "image/png",
Content: "{BASE64_ENCODED_FILE}",
}
m.Messages.Create("{SERVER_ID}", &MessageCreateOptions{
To: "someone@example.com",
Subject: "Email from Mailosaur",
Html: "<p>Hello world.</p>",
Send: true,
Attachments: []Attachment{attachment},
})