vendredi 30 janvier 2015

InvalidParameterValue: Duplicate header 'Content-Type' when send RawMessage with Amazon SES

I'm trying to send a raw email message with Amazon SES API to include attachment.

SES reponse with 400 status code and I not sure what I'm doing wrong, here is the response:



<ErrorResponse xmlns="http://ift.tt/1vMoAG1">
<Error>
<Type>Sender</Type>
<Code>InvalidParameterValue</Code>
<Message>Duplicate header 'Content-Type'.</Message>
</Error>
<RequestId>ad8cb17c-a8a0-11e4-8898-8924aa87abfa</RequestId>
</ErrorResponse>


The request signed and work OK with other request, so I think it must only my email message issue. Here is my message data:



Cc: my-verified-email-1@gmail.com
Subject: Hello testing email hahahahaha
Mime-Version: 1.0
Date: 30 Jan 15 23:54 +0700
Content-Type: multipart/mixed; boundary=7f1a313ee430f85a8b054f085ae67abd6ee9c52aa8d056e7f7e19c6e2887
From: my-verified-email-2@gmail.com
To: my-verified-email-3@gmail.com
--7f1a313ee430f85a8b054f085ae67abd6ee9c52aa8d056e7f7e19c6e2887
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hello <b>testing email</b> with some =E4=B8=96=E7=95=8C and Vi=E1=BB=87t ng=
=E1=BB=AF.
--7f1a313ee430f85a8b054f085ae67abd6ee9c52aa8d056e7f7e19c6e2887
Content-Type: text/plain; charset=utf-8; name="test1.txt"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="test1.txt"

dGVzdGluZyBzdHJpbmcgd2l0aCBWaeG7h3Qgbmfhu68K
--7f1a313ee430f85a8b054f085ae67abd6ee9c52aa8d056e7f7e19c6e2887--




Aucun commentaire:

Enregistrer un commentaire