2015-01-30 1 views
1

첨부 파일을 포함하도록 Amazon SES API가 포함 된 원시 이메일 메시지를 보내려고합니다. 400 상태 코드가
SES의 reponse 내가하고, 여기에 응답 내가 잘못 무엇인지 확실하지 :InvalidParameterValue : Amazon SES를 사용하여 RawMessage를 보낼 때 'Content-Type'중복 헤더

<ErrorResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/"> 
    <Error> 
    <Type>Sender</Type> 
    <Code>InvalidParameterValue</Code> 
    <Message>Duplicate header 'Content-Type'.</Message> 
    </Error> 
    <RequestId>ad8cb17c-a8a0-11e4-8898-8924aa87abfa</RequestId> 
</ErrorResponse> 

요청 서명 및 기타 요청과 확인 작업, 그래서 그것을 단지 내 전자 메일 메시지를 생각합니다 발행물. 내 메시지 데이터는 다음과 같습니다.

Cc: [email protected] 
Subject: Hello testing email hahahahaha 
Mime-Version: 1.0 
Date: 30 Jan 15 23:54 +0700 
Content-Type: multipart/mixed; boundary=7f1a313ee430f85a8b054f085ae67abd6ee9c52aa8d056e7f7e19c6e2887 
From: [email protected] 
To: [email protected] 
--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-- 

답변

3

확인을 클릭하면 첫 번째 경계선 앞에서 새 줄이 누락되었습니다. 메시지는 다음과 같아야합니다.

Cc: [email protected] 
Subject: Hello testing email hahahahaha 
Mime-Version: 1.0 
Date: 30 Jan 15 23:54 +0700 
Content-Type: multipart/mixed; boundary=7f1a313ee430f85a8b054f085ae67abd6ee9c52aa8d056e7f7e19c6e2887 
From: [email protected] 
To: [email protected] 

--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-- 
관련 문제