聽起來像它應該是海峽前進,但我不能讓它工作。AWS SES send_email()對我來說不起作用,總是「意外的列表元素終止」
我已閱讀send_email的API參考 我已閱讀與此相關的其他線索,以及其他網站。我使用的代碼樣本,以確保我的參數數組正確嵌套(盡我所能想出),但一切都讓「意外列表元素終止」
function amazonSesEmail($to, $subject, $message)
{
$amazonSes = new AmazonSES(); //
$response = $amazonSes->send_email('[email protected]',
array('ToAddresses' => $to),
array(
'Subject.Data' => $subject,
'Body.Text.Data' => $message,
)
);
return $response;
}
我也試過在絕望的這樣亂七八糟的東西試圖追隨參考結構:
$aws_reply = $aws_ses->send_email( $fromEmailAddress,
array('ToAddresses' => '[email protected]'),
array(
array( 'Subject' => array('Data' => 'New Request '),
'Body' => array('Text' => array('Data' => 'New Request '))
)
)
);
在所有情況下,當我的print_r($響應),這是詳細信息:
CFResponse Object
(
[header] => Array
(
[x-amzn-requestid] => xxxx-xxxxx
[content-type] => text/xml
[content-length] => 280
[date] => Fri, 16 Dec 2011 03:24:07 GMT
[_info] => Array
(
[url] => https://xxxxx/
[content_type] => text/xml
[http_code] => 400
[header_size] => 166
[request_size] => 1088
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 0.349242
[namelookup_time] => 0.156135
[connect_time] => 0.189468
[pretransfer_time] => 0.28083
[size_upload] => 185
[size_download] => 280
[speed_download] => 801
[speed_upload] => 529
[download_content_length] => 280
[upload_content_length] => 185
[starttransfer_time] => 0.349204
[redirect_time] => 0
[certinfo] => Array
(
)
[method] => POST
)
[x-aws-stringtosign] => Fri, 16 Dec 2011 03:24:06 GMT68492574-F715-4AE3-B153-9446AE80866D
[x-aws-request-headers] => Array
(
[Content-Length] => 185
[Content-MD5] => 9+iobwTmkId+4ZmGt+6CDw==
[Content-Type] => application/x-www-form-urlencoded; charset=utf-8
[Date] => Fri, 16 Dec 2011 03:24:06 GMT
[Host] => xxxxxxxxxx.com
[X-Amz-Nonce] => xxx
[X-Amzn-Authorization] => AWS3-HTTPS AWSAccessKeyId=xxx,Algorithm=HmacSHA256,SignedHeaders=Content-Length;Content-MD5;Content-Type;Date;Host;X-Amz-Nonce,Signature=xxxx
)
[x-aws-body] => Action=SendEmail&Destination.ToAddresses=xxxx%40gmail.com&Message.Body.Text.Data=test%20body&Message.Subject.Data=test%20subject&Source=xxxxx%40gmail.com&Version=2010-12-01
)
[body] => CFSimpleXML Object
(
[@attributes] => Array
(
[ns] => http://xxxx
)
[Error] => CFSimpleXML Object
(
[Type] => Sender
[Code] => MalformedInput
[Message] => Unexpected list element termination
)
[RequestId] => xxxxx
)
[status] => 400
)
我撕出我的頭髮在這個爲股份公司ain,它應該是這樣的海峽,但我似乎無法滿足它的格式要求,並且似乎適用於其他已經博客的人不適合我。任何來自以前完成此操作的人的輸入都將不勝感激!
我應該補充一點,我仍然在SES沙盒中,並試圖從授權的電子郵件發送給自己。 – DeviousBlue 2011-12-16 03:47:30
有沒有解決這個問題的方法? – stwhite 2012-01-06 04:27:03