我已经使用 PHP SDK 设置了 AWS Ses 服务:
$this->client = SesClient::factory([
'key' => $params['key'],
'secretKey' => $params['secret_key'],
'region' => 'eu-west-1',
'base_url' => 'https://email-smtp.eu-west-1.amazonaws.com',
]);
$this->client->sendEmail($this->params());
public function params() {
array(
'Source' => 'verified@gmail.com',
'Destination' => array(
'ToAddresses' => array('receiver@yahoo.com')
),
'Message' => array(
'Subject' => array(
'Data' => 'SES Testing',
'Charset' => 'UTF-8',
),
// Body is required
'Body' => array(
'Text' => array(
'Data' => 'My plain text email',
'Charset' => 'UTF-8',
),
'Html' => array(
'Data' => '<b>My HTML Email</b>',
'Charset' => 'UTF-8',
),
),
),
'ReplyToAddresses' => array( 'replyTo@email.com' ),
'ReturnPath' => 'bounce@email.com'
);
}
尝试发送电子邮件后,我收到此错误消息:
exception 'Guzzle\Http\Exception\CurlException' with message
'[curl] 23: Failed writing body (0 != 86) [url] https://email-smtp.eu-west-1.amazonaws.com/'
in C:\xampp\htdocs\myProject\protected\lib\vendor\guzzle\guzzle\src\Guzzle\Http\Curl\CurlMulti.php:338
任何人都知道如何解决该错误?
cUrl 支持 SMTP,但smtp://email-smtp.eu-west-1.amazonaws.com
抛出错误[curl] 1: Protocol smtp not supported or disabled in libcurl [url] smtp://email-smtp.eu-west-1.amazonaws.com/