我在 Rackspace 上运行一个云应用程序(使用 CakePHP),我想使用 cakephp 发送电子邮件。我用这个:https ://github.com/kochb/cakephp-mailgun 但它返回给我一个
"Could not send email.
Error: An Internal Error Has Occurred."
错误。我尝试发送电子邮件的方式是使用以下代码:
$Email = new CakeEmail();
$from = $this->request->data['Mail']['from'];
$to = ($this->request->data['Mail']['to']);
$subject = $this->request->data['Mail']['subject'];
$message = $this->request->data['Mail']['message'];
$Email->sender($from, 'TestName');
$Email->from($from)
->bcc($to)
->replyTo($from)
->subject($subject)
->send($message);
$this->Session->setFlash('On the way to recipient');
$this->redirect(array('action' => 'index'));
我已经编辑了插入 MailGun API 凭据等的 Config/Email.php 文件。
可能发生了什么?你能找出为什么会这样吗?
提前致谢!