AWS javascript SDK SES SendMail Invalid address

I am trying to send mail using AWS SES.

Here's the error I see:

{ "message": "Illegal address", "code": "InvalidParameterValue", "time": "2017-06-02T03:12:37.110Z", "requestId": "544c6aee-4741-11e7-9cf5-a709f069aa99", "statusCode": 400, "retryable": false, "retryDelay": 73.04001529701054 } 

Here, the request object is passed to the SendMail AWS.SES method for the javascript SDK.

 { "Destination": { "BccAddresses": [], "CcAddresses": [], "ToAddresses": [ " success@simulator.amazonses.com " ] }, "Message": { "Body": { "Html": { "Charset": "UTF-8", "Data": "You have been removed from Kudo mailing list for account: bob@gmail.com " }, "Text": { "Charset": "UTF-8", "Data": "You have been removed from Kudo mailing list for account: bob@gmail.com " } }, "Subject": { "Charset": "UTF-8", "Data": "Kudo email removal" } }, "ReplyToAddresses": [], "ReturnPath": "", "ReturnPathArn": "", "Source": " donotreply@kudo.io ", "SourceArn": "arn:aws:ses:us-west-2:1xxxxxxxxxx2:identity/ donotreply@kudo.io " } 

bob@gmail.com checked in my account (which is still in sandbox mode). donotreply@kudo.io also checked in my account.

Edit: I just tested it using test emails in SES and it worked ... still can't get it to send using the SDK.

+5
source share
1 answer

Well, the key is to remove the blank lines for ReturnPath and ReturnPathArn and SourceArn if you are not using it. As soon as I did this, it worked.

Source: https://forums.aws.amazon.com/thread.jspa?messageID=787424󀏠

 { "Destination": { "BccAddresses": [], "CcAddresses": [], "ToAddresses": [ " success@simulator.amazonses.com " ] }, "Message": { "Body": { "Html": { "Charset": "UTF-8", "Data": "You have been removed from Kudo mailing list for account: bob@gmail.com " }, "Text": { "Charset": "UTF-8", "Data": "You have been removed from Kudo mailing list for account: bob@gmail.com " } }, "Subject": { "Charset": "UTF-8", "Data": "Kudo email removal" } }, "ReplyToAddresses": [], "Source": " donotreply@kudo.io " } 
+6
source

Source: https://habr.com/ru/post/1268454/


All Articles