In order to send a MimeMessage
using Apachae Camel AWS SES, you can just send the raw MimeMessage
. There is no need to wrap it in a RawMessage
nor a SendRawEmailRequest
.
Sending a full SendRawEmailRequest
object will be supported in newer Camel Versions (>= 4.10
), as can be tracked here: https://issues.apache.org/jira/browse/CAMEL-21593.
Based upon the above stated, the working code for the example above would look like the following:
from("direct:sendEmail")
.process(exchange -> {
// Create MIME message with attachment
MimeMessage mimeMessage = createMimeMessageWithAttachment();
// Set RawMessage in the Camel body
exchange.getIn().setBody(mimeMessage);
})
.to("aws2-ses://x");