This topic describes how to send an email with attachments using SMTP.
To send an email with attachments using SMTP, you must construct the email body in the Multipurpose Internet Mail Extensions (MIME) format.
MIME basics
MIME is an Internet standard that extends the format of email messages.
For more information, see RFC 2045.
The total size of an email with attachments cannot exceed 15 MB. An email can contain a maximum of 100 attachments.
The 15 MB limit applies to the total size of the sent email, which includes the message header, body, and attachments. Because Base64 encoding increases the file size, the final email can be more than 1.5 times the size of the original attachments. Therefore, we recommend that you limit the total size of your attachments to 8 MB or less. To send larger files, add hyperlinks to them in the email body.
For sample code, see: