How to Send an Email with Attachments via the API
Problem reported by yerim kim - 9/20/2025 at 11:22 AM
Submitted

Hello,

I would like to attach a file when sending mail through the SendMessage API. Which parameter should I use for this?

I could not find the answer in the API documentation or in the community.

Derek Curtis Replied
Employee Post
Hi, Yerim

We do have an AddAttachment API for composing messages. It's documented here (you'll need to substitute your mail server address):

https://mail.your-mail-domain.com/Documentation/api#/reference/SmarterMail.Web.Api.MailController/AddAttachment/post

This call is generally used for inline attachments, hence the need for a ContentID. If you leave that part off, it MAY add a file as a standard attachment, but we've not tested that. (We're in the process of it.) One thing to note is that any file that's uploaded needs to be done using form data. 
Derek Curtis COO SmarterTools Inc. www.smartertools.com

Reply to Thread

Enter the verification text