Receiving email takes upto 3 hours
This is my code I am facing problem in receiving mail it take up to 3 hours. Please help me.
function sendMail($to, $subject, $template, $from,$params,$attachmentFile=array(),$layout='default') {
foreach($params as $key=>$val) {
$this->set("".$key."",$val);
}
$this->Email->sendAs = 'html';
if (is_array($to))
$this->Email->to = $to;
else
$this->Email->to = "<".$to.">";
//$this->Email->to;
$this->Email->subject = $subject;
$this->Email->layout = $layout;
$this->Email->replyTo = "test@gmail.com";
$this->Email->from = "test@gmail.com";
$this->Email->attachments = $attachmentFile;
$this->Email->template = $template; // note no '.ctp'
//echo "<pre>";print_r($this->Email);
//die();
if(!$this->Email->send()) {
return 0;
}
else {开发者_如何学Python
return 1;
}
}
Email is not instant. Sometimes a normal email will take quite a while. I would check what server (be it an SMTP server or plain old sendmail) you are using though and try to send mail through that normally to see how long it takes to make sure that it's not a cakephp configuration issue.
精彩评论