capabilities.work

Compose, Attach, and Send Mail

A 3-step recipe with Microsoft Exchange. We can help you get access.

Recipe · 3 steps

Compose, Attach, and Send Mail

Draft a message, attach a file, and send it via Microsoft Graph.

  1. Create a draft message in the Drafts folder with a subject, HTML body, and a single To recipient.
  2. Attach a base64-encoded file to the draft message using the fileAttachment OData type.
  3. Send the prepared draft message. Microsoft Graph accepts the request for delivery and saves the message in Sent Items.
What you'll need to have ready
  • subject: The subject line of the message.
  • bodyContent: The HTML body content of the message.
  • toAddress: The primary recipient email address.
  • attachmentName: The display name of the file attachment.
  • attachmentContentType: The MIME type of the attachment (e.g. application/pdf).
  • attachmentContentBytes: The base64-encoded contents of the attachment file.
For your developer

Arazzo workflow microsoft-exchange:compose-attach-send-mail, 3 operations: createDraftMessage → addMessageAttachment → sendDraftMessage. Specs on APIs.io.