動作中の 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();