Take a look at the SendRawEmail example:
/* The following example sends an email with an attachment: */
var params = {
Destinations: [],
FromArn: "",
RawMessage: {
Data: <Binary String>
},
ReturnPathArn: "",
Source: "",
SourceArn: ""
};
ses.sendRawEmail(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
/*
data = {
MessageId: "EXAMPLEf3f73d99b-c63fb06f-d263-41f8-a0fb-d0dc67d56c07-000000"
}
*/
});
Reference: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/SES.html
Important: you need to understand the MIME type standards to include your attachment. Take a look at this article.
MIME was defined in 1992 by the Internet Engineering Task Force
(IETF). The distinguishing characteristic of a MIME message is the
presence of the MIME headers. As long as your mail recipients also
have e-mail software that is MIME-compliant (and most e-mail software
is), you can swap files containing attachments automatically.
EDIT: This article explains how to include attachment in your body.
MIME completes the illusion of file attachments by allowing the
message body to be divided into distinct parts, each with their own
headers. The content type multipart/mixed means that the content of
the body is divided into blocks separated by "--" + a unique string
guaranteed to not be found anywhere else in the message. If you say
that your boundary string is "MyBoundaryString", then all occurrences
of that string will be treated as a boundary. So it better not be in
the message the user typed or it won't be decoded correctly.
Wikipedia also gives an example:
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=frontier
This is a message with multiple parts in MIME format.
--frontier
Content-Type: text/plain
This is the body of the message.
--frontier
Content-Type: application/octet-stream
Content-Transfer-Encoding: base64
PGh0bWw+CiAgPGhlYWQ+CiAgPC9oZWFkPgogIDxib2R5PgogICAgPHA+VGhpcyBpcyB0aGUg
Ym9keSBvZiB0aGUgbWVzc2FnZS48L3A+CiAgPC9ib2R5Pgo8L2h0bWw+Cg==
--frontier--
I assume you are familiar with Base64.