mithlesh
mithlesh

Reputation: 11

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 = "[email protected]";

$this->Email->from = "[email protected]";

$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 {

return 1;

}

}

Upvotes: 0

Views: 126

Answers (1)

ridecar2
ridecar2

Reputation: 1957

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.

Upvotes: 2

Related Questions