I'm trying to sends mails in PHP. The code I used for sending a mail in CakePHP is given below. I get the message 'Simple Email Sent' in my web page but the mail is not delivered to my inbox. Am I missing something?
The values in the to
, subject
and link
fields are set with the values entered in the user interface.
$this->set('to',$this->params['form']['to']);
$this->set('subject',$this->params['form']['subject']);
$this->set('link',$this->params['form']['link']);
$this->Email->to = to;
$this->Email->subject = subject;
$this->Email->from = '[email protected]';
$this->Email->delivery= 'mail';
$this->Email->sendAs='text';
$this->Email->template = 'simple_message';
//$this->Email->send(link);
if ( $this->Email->send(link) ) {
$this->Session->setFlash('Simple email sent');
} else {
$this->Session->setFlash('Simple email not sent');
}