我已经下载了codeigniter亚马逊SES(简单的电子邮件服务) 在这里下载:http://getsparks.org/packages/amazon-ses/versions/HEAD/show
还从这里下载了Phil Sturgeon的CodeIgniter cURL库: http://getsparks.org/packages/curl/show
我正在尝试使用以下代码发送电子邮件以测试它是否有效:
$this->load->library('Amazon_ses');
$this->amazon_ses->to("me@example.com");
$this->amazon_ses->subject("test");
$this->amazon_ses->message("test");
$this->amazon_ses->send();
在codeigniter错误日志中,我收到以下消息:
DEBUG - 2013-02-05 23:42:17 --> Config Class Initialized
DEBUG - 2013-02-05 23:42:17 --> Hooks Class Initialized
DEBUG - 2013-02-05 23:42:17 --> Utf8 Class Initialized
DEBUG - 2013-02-05 23:42:17 --> UTF-8 Support Enabled
DEBUG - 2013-02-05 23:42:17 --> URI Class Initialized
DEBUG - 2013-02-05 23:42:17 --> Router Class Initialized
DEBUG - 2013-02-05 23:42:17 --> Output Class Initialized
DEBUG - 2013-02-05 23:42:17 --> Security Class Initialized
DEBUG - 2013-02-05 23:42:17 --> Input Class Initialized
DEBUG - 2013-02-05 23:42:17 --> Global POST and COOKIE data sanitized
DEBUG - 2013-02-05 23:42:17 --> Language Class Initialized
DEBUG - 2013-02-05 23:42:17 --> Loader Class Initialized
DEBUG - 2013-02-05 23:42:17 --> Controller Class Initialized
DEBUG - 2013-02-05 23:42:17 --> Amazon SES Class Initialized
DEBUG - 2013-02-05 23:42:17 --> Config file loaded: application/config/amazon_ses.php
DEBUG - 2013-02-05 23:42:17 --> cURL Class Initialized
DEBUG - 2013-02-05 23:42:17 --> Helper loaded: email_helper
DEBUG - 2013-02-05 23:42:17 --> API request failed.
DEBUG - 2013-02-05 23:42:17 --> Final output sent to browser
DEBUG - 2013-02-05 23:42:17 --> Total execution time: 0.0722
“API请求失败”行似乎是问题所在。
我已经尝试在PhpED中调试并在Curl.php文件的第307行(在Curl包中下载的文件之一)中找到了一个$ error变量,其值等于:
“错误设置证书验证位置:\ n CAfile: certs / cacert.pem \ n CApath:none \ n“
libary需要使用一组公共根证书。 (将http://添加到以下地址,我只允许发布两个超链接作为新用户)
(例如curl.haxx.se/ca/cacert.pem)
我已下载并将其放在codeigniter的application / certs目录中。似乎图书馆找不到它或者不喜欢我提供的路径。我在amazon_ses.php文件中指定的路径(亚马逊ses库下载附带的文件之一)如下:
'证书/ cacert.pem'
我已经尝试过application / certs / cacert.pem以及完整路径(localhost ...)
任何人都知道我做错了什么?