Sending attachment using AWS SNS(Simple Notification Service)

Shubham Mishra picture Shubham Mishra · Aug 25, 2015 · Viewed 11.2k times · Source

I am using AWS SNS for sending alert emails. Now the email content is really long therefore I wish to send it as a file attachment rather than sending it as a email content. Can this be done using SNS ?

Answer

Michael - sqlbot picture Michael - sqlbot · Aug 26, 2015

No, it can't.

The SNS FAQ does not come out and explain this explicitly, but it can be inferred from several statements:

Amazon SNS messages can contain up to 256 KB of text data, including XML, JSON and unformatted text.

The ”Email” transport is meant for end-users/consumers and notifications are regular, text-based messages which are easily readable.

In addition, since you do not have access to the email header space when publishing to SNS, it is not possible to specify the necessary multipart coding for an email client to decide an embedded attachment. You can't even send HTML emails (well, you could, but a standards-conforming email client would not render them as HTML).

Now, many email clients will theoretically recognize http://... in an email body and turn them into clickable links, allowing you to link to the desired file... but that of course is not the same thing as attaching files.

I there does not appear to be a mechanism for attaching files to emails in SNS.