AWS SES Raw Email Sending refers to the advanced capability in Amazon Simple Email Service that allows developers to craft and send fully customized email messages with complete control over every aspect of the email structure, format, and content.
Raw email sending in Amazon SES provides developers with direct control over the entire MIME structure, including headers, body parts, attachments, and encoding. Unlike the simplified sending methods that abstract away email complexity, raw email sending exposes the underlying email protocols and standards, allowing for maximum customization and flexibility.
This approach enables precise control over essential email components that affect deliverability, rendering, and recipient experience. According to the AWS documentation, raw email sending is particularly valuable for applications requiring sophisticated formatting, attachments, or custom headers that aren't available through simpler API methods.
The raw email sending process in SES follows a streamlined workflow where you first construct a complete MIME message with all required headers and body content, then transmit this message to AWS using either the SendRawEmail
API operation or SMTP interface with proper encoding, after which AWS SES performs essential verification checks while minimizing alterations to your carefully crafted message, and finally manages the entire delivery process including retries, bounce handling, complaint processing, and delivery notification distribution according to the verified identity's configuration settings.
Raw email sending is particularly valuable in several scenarios:
Use Case | Why Raw Sending Helps |
---|---|
Transactional Emails with Attachments | Send order confirmations, invoices, or receipts with PDF attachments while maintaining precise branding and format control |
Calendar Invitations | Include properly formatted iCalendar (ICS) components that work reliably across email clients |
Digitally Signed Messages | Implement S/MIME signatures for enhanced security and authentication in regulated industries |
Custom Email Headers | Add specialized headers for tracking, categorization, authentication, or internal routing purposes |
Raw email sending can be implemented through two primary interfaces:
SendRawEmail API: This programmatic approach allows sending raw messages through AWS SDK calls. It requires properly formatting the entire message according to MIME standards and encoding it as required by the API specification.
SMTP Interface: AWS SES provides an SMTP endpoint that can accept raw email messages. This approach is particularly useful for integrating with existing applications that already support SMTP as a sending method.
For both approaches, AWS recommends using established email libraries that handle the complexities of MIME formatting and encoding rather than attempting to construct raw messages manually. Libraries like Nodemailer for Node.js, JavaMail for Java, and email for Python provide robust capabilities for constructing standards-compliant raw messages.
When implementing raw email sending, several factors require careful attention:
Use raw sending for advanced features like attachments or custom headers; simple APIs are best for basic emails.
Yes, if not implemented correctly. Follow best practices to maintain good deliverability.
SES templates don’t work directly, but you can create your own templates for raw emails.
Manually add tracking pixels and rewrite links, or use a third-party tracking tool.
Email communication is part of your product! Don't let it ruin your user's experience with your brand