I'm using the latest JS SDK, and cannot send a raw email without a confusing error.
Here's my code:
const msg = mimemessage.factory({
contentType: 'text/plain',
contentTransferEncoding: 'base64',
body: 'hello world'
})
msg.header('From', 'Admin <hello@condobeaver.com>')
msg.header('To', destination)
msg.header('Subject', 'Customer service contact info')
const command = new SendRawEmailCommand({
Destinations: [destination],
Source: 'hello@condobeaver.com',
RawMessage: { Data: msg.toString() }
})
console.log(command)
const response = await client.send(command)
The output of command is:
SendRawEmailCommand2 {
middlewareStack: {
add: [Function: add],
addRelativeTo: [Function: addRelativeTo],
clone: [Function: clone],
use: [Function: use],
remove: [Function: remove],
removeByTag: [Function: removeByTag],
concat: [Function: concat],
applyToStack: [Function: cloneTo],
resolve: [Function: resolve]
},
input: {
Destinations: [ 'ilia.reingold@gmail.com' ],
Source: 'hello@condobeaver.com',
RawMessage: {
Data: 'Content-Type: text/plain\r\n' +
'Content-Transfer-Encoding: base64\r\n' +
'From: Admin <hello@condobeaver.com>\r\n' +
'To: ilia.reingold@gmail.com\r\n' +
'Subject: Customer service contact info\r\n' +
'\r\n' +
'hello world'
}
}
}
It seems to have everything I need: to/from/subject/content.
Yet when I run it, I get:
InvalidParameterValue: Empty header names are illegal.
What header is empty?
from AWS sendRawEmail - InvalidParameterValue: Empty header names are illegal
No comments:
Post a Comment