기본 이메일을 보내는 코드가 있습니다. 하지만 SMTP를 들어, 내가이 완벽하지 못했습니다 :smtp를 통해 cakephp를 사용하여 이메일 보내기
function send(){
$this->Email->smtpOptions = array(
'port'=>'465',
'timeout'=>'30',
'host' => 'ssl://smtp.gmail.com',
'username'=>'[email protected]',
'password'=>'mypassword',
);
$this->Email->delivery='smtp';
$this->Email->send = 'debug';
$this->Email->to = '[email protected]';
$this->Email->subject = 'hurrah';
// $this->Email->replyTo = '[email protected]';
$this->Email->from = 'Charmaine Khay Sorila<[email protected]>';
//$this->Email->send('Here is the body of the email Chams Email Test');
//Set the body of the mail as we send it.
//Note: the text can be an array, each element will appear as a
//seperate line in the message body.
if ($this->Email->send()) {
$this->Session->setFlash('Simple email sent');
} else {
$this->Session->setFlash('Simple email not sent');
$this->set('smtp_errors', $this->Email->smtpError);
}
}
}
내가가되고, $ this-> email-> 전달 = 'SMTP'없이이 작업을 얻었다 ;,하지만 난 그 라인을 추가 할 때, 어떤 이메일이 모두 전송 될 수 없다 당신이 실제로 이메일을 보내 대신 기능을 테스트 할 싶지 않은 경우 :(
디버그 옵션을 사용하는지, 그것을 제거하려고 – yossi
똑같은 것 yossi.. 실제로 실제로 일어나는 일은 몇 초 동안 페이지가로드되어 이메일을 보내지 않는 것입니다 ... : – Charmie
첫 번째 : 당신이 얻는 오류 (s?)는 무엇입니까? – yossi