【发布时间】:2012-01-30 15:10:37
【问题描述】:
我在 Linux 服务器 (Ubuntu 10.10) 上使用来自 PHP (CakePHP 1.3) 的 sendmail,它需要很长时间才能执行,但最终会通过。 SMTP 作为守护进程运行——有一段时间,我认为问题在于它必须在每个 send() 上启动进程。
在服务器配置方面,我有点新手,因此非常感谢任何帮助。
这是我的应用代码,供参考:
$this->Email->from = 'Hello <hello@example.com>';
$this->Email->to = 'Hello <hello@example.com>';
$this->Email->subject = 'Hello';
$this->Email->sendAs = 'html';
$this->Email->template = 'my_template';
$this->data['Inquiry']['id']= $this->Inquiry->id;
$this->set('inquiry', $this->data['Inquiry']);
$this->Email->send();
【问题讨论】:
-
也许您的邮件日志文件中有任何指针?
-
常识:使用一致的命名约定被认为是最佳实践,所有变量、属性、函数和方法名称都应小写,多个单词可以使用_underscores_each 或使用CamelCase 命名。只有类名的第一个字母应该大写。
-
如果邮件真的被送达了,那么可能是您的 smtp/sendmail 守护进程将邮件集中起来并以间隔间隔发送。
标签: php cakephp smtp sendmail ubuntu-10.10