I have uploaded a working Cakephp web application to Mosso Cloud Sites hosting. The application is working fine except that emails are no longer being delivered. The site is an exact copy from my previous host, where sending email was working correctly. The app uses the built in Cakephp email component. I have searched Mosso's knowledgebase and followed the directions for php email (htaccess method) here. My script is as follows:
$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();