Amazon SES 错误:缺少必需的标头“To”

Pac*_*nSV 4 php email send amazon-ses

我是 Amazon SES 的新手,我正在尝试使用以下代码发送电子邮件:

<?php
    require_once 'aws/sdk.class.php';

    $ses = new AmazonSES();
    $to = array('ToAddress' => 'mario@wowfi.com');
    $content = array('Subject.Data' => 'Tema', 'Body.Text.Data' => 'hello');
    $r = $ses->send_email("mario@wowfi.com", $to , $content);
    print_r($r);
?>
Run Code Online (Sandbox Code Playgroud)

在输出中它说:缺少必需的标题“To”,我做错了什么?

Pac*_*nSV 5

我已经解决了,我的代码中有两个问题:

  1. 索引“ToAddress”不正确,它必须是复数形式的“ToAddresses”。
  2. 它的值必须是这样的数组:array('mario@wowfi.com')