1
我在Rackspace上运行一个云应用(使用CakePHP),我想用cakephp发送邮件。 我用这个:https://github.com/kochb/cakephp-mailgun 但它返回我一个在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'));
我已经编辑配置/ Email.php文件中插入MailGun API凭证等
什么可能是怎么回事?你能找出为什么会发生这种情况吗?
在此先感谢!
你可以试试 “从” 规定, “对”, “主题” 等手?我从字面上复制了您的示例,但设置了这些参数,并且发送的信息没有问题。这是[Gist](https://gist.github.com/travelton/6160051)。 –