0

我已将一个正常工作的 Cakephp Web 应用程序上传到 Mosso Cloud Sites 托管。该应用程序运行良好,只是不再发送电子邮件。该站点是我以前的主机的精确副本,发送电子邮件工作正常。该应用程序使用内置的 Cakephp 电子邮件组件。我搜索了 Mosso 的知识库并按照此处的 php 电子邮件(htaccess 方法)的说明进行操作。我的脚本如下:

    $this->Email->reset();
    $this->Email->sendAs = 'html'; // both = html + plain text
    $this->Email->to = '"'.$data['Customer']['first_name'].' '.$data['Customer']['last_name'].'" <' . $data['Customer']['email']. '>';
    $this->Email->bcc = $this->_generateRecipients($data['Booking']['sales_associate_id']);
    $this->Email->from = '<noreply@'.env('HTTP_HOST').'>';
    $this->Email->replyTo = '<noreply@'.env('HTTP_HOST').'>';
    $this->Email->return = '<noreply@'.env('HTTP_HOST').'>';
    $this->Email->subject = 'Rental Receipt';

    // Select appropraite email template
    switch ($this->Session->read('site_id')) {
        case '100':
            $this->Email->template = 'vac_receipt1';
            break;
        case '200':
            $this->Email->template = 'vac_receipt2';
            break;
    }

    $this->Email->send();
4

2 回答 2

1

我会发表评论,但还没有声誉..

无论如何,您是否检查了 send() 返回值?您的日志文件中是否有任何错误?如果没有错误并且返回值很好,您可能应该联系主机的支持。

于 2009-04-09T09:48:22.733 回答
0

在与 Mosso 员工详细讨论了这个问题后,他们的一位 linux 管理员介入并在审查了代码后指出,Mosso 云站点电子邮件系统不支持代码生成的电子邮件的密件抄送或抄送。因此,由于我的代码使用 Bcc 向我们的员工和客户发送副本,因此我的电子邮件没有被发送,也没有抛出 PHP 错误。

因此,如果您使用 Mosso Cloud 站点,您将无法通过代码发送带有密件抄送或抄送的电子邮件。吸取的教训,但在他们的知识库中应该更容易找到。

于 2009-04-22T16:26:12.590 回答