Attachments and inline images

Send attachment bytes as base64 with a filename. Hedvi does not download attachment URLs on your behalf.

Encode the file, set its name and media type, then inspect the test capture.
Check decoded file size and actual mail-client rendering. View full-size diagram
{
  "from": "app@example.com",
  "to": "you@example.com",
  "subject": "Your document",
  "text": "Your document is attached.",
  "attachments": [
    {
      "filename": "hello.txt",
      "content_type": "text/plain",
      "content": "SGVsbG8gZnJvbSBIZWR2aQ=="
    }
  ]
}
  1. Read the file on your server and base64-encode its bytes.
  2. Set filename and the correct content_type.
  3. For an inline image, add content_id (for example logo) and reference it with <img src="cid:logo" alt="Company logo"> in the HTML.
  4. Send with a test key first and inspect the capture. Then test the template in the mail clients your recipients use.

Maximum: 10 attachments and 10 MB total HTML, text and decoded attachments. Executable file types are refused. Outgoing attachment data also has a monthly plan budget, multiplied by recipients where applicable. Use links to your own secure file service for larger documents.