我正在开发一个基于 Codeigniter 的网站,我需要在人们注册时向他们发送电子邮件。我的服务器托管在 Amazon EC2 上。
我正在尝试使用他们的 Amazon Simple Email Service,并且我正在使用下面的库来使其正常工作。我没有收到错误,但发送失败。我目前处于沙盒模式,所以我只能发送(当它工作时)到我注册的电子邮件地址,但这也失败了。
我已经使用我的 AWS 凭证配置了库。有什么问题?
这是我正在使用的库:
https://github.com/joelcox/codeigniter-amazon-ses
这是我的控制器代码:
// Load the Library
$this->load->library('amazon_ses');
// Configure and send email
$this->amazon_ses->to('registered@email.com');
$this->amazon_ses->subject('Open me!');
$this->amazon_ses->message('<strong>Use HTML</strong>');
if ($this->amazon_ses->send()) {
echo "Successfully sent!";
} else {
echo "Failure!";
}
$this->amazon_ses->debug(TRUE);