Mails are not sending via form
Hi everyone,
I have a problem sending mails via PHPCake. But first of all let's see the context.
I am not familiar with CakePHP, neither working with Cpanel. My uncle has a website where people could make a reservation. After a form is completed a mail with the details is sent to the company. Like for 6 months he didn't receive any mails. I entered his website and completed a form, click on a button to make a reservation, but no mail was sent. I took a look on the code, but everything seems to be fine there.
[PHP]Captcha->model = 'Contact';
}
function index(){
if(!empty($this->data)){
if($this->Captcha->validate()){
$this->Contact->set($this->data);
if($this->Contact->validates()){
$this->set('email_data', $this->data);
$this->Email->reset();
$this->Email->to = 'somebody@gmail.com';
$this->Email->subject = __('Contact prin form web',true).' : '.$this->data['Contact">['subject">;
$this->Email->replyTo = $this->data['Contact">['email">;
$this->Email->from = $this->data['Contact">['name">;
$this->Email->layout = 'contact'; // note no '.ctp'
$this->Email->template = 'contact_email'; // note no '.ctp'
//Send as 'html', 'text' or 'both' (default is 'text')
$this->set('contact',$this->data);
$this->Email->sendAs = 'html'; // because we like to send pretty mail
$this->Email->send();
$this->Session->setFlash(__('Mesajul a fost trimis. Va vom raspunde cat mai repede posibil.', true));
$this->redirect(array('action'=>'index'));
}
}else{
$this->Session->setFlash(__('Nu ati raspuns corect la intrebarea matematica.' + $this->data['Contact">['name">, true));
$this->redirect(array('action'=>'index'));
}
}
$this->set('title', 'Some title');
$this->set('captcha',$this->Captcha->generate());
}
}
?>[/PHP]
It worked before, it is not working like for 6 months. Is there a file where the mail settings are configured in Cpanel? Can I check for some logs somewhere? It is possible that the rights to send mails to expire or something like that?
Thank you for helping!
PS: The code is not written by me :).
-
Can you please check the logs, tail -f /var/log/exim_mainlog and then send a email and let us know. Also check if you have not disable php email on the server. 0 -
Hello, Your access level shows as "Website Owner". I recommend reporting this issue to your web hosting provider so they can verify if sending email via PHP is allowed (or disabled) on the server. Thank you. 0
Please sign in to leave a comment.
Comments
2 comments