나는 cakephp 전자 메일 구성 요소를 처음으로 살펴 보았습니다. 내 로컬 호스트에서 다음과 같은 이메일을 보내고 있습니다.Gmail에서 smtp를 사용하여 localhost에서 이메일을 보낼 수 없습니까?
$this->Email->smtpOptions = array( 'port'=>'465',
'timeout'=>'30',
'host'=>'smtp.gmail.com',
'username'=>'[email protected]',
'password'=>'mygmailpassword'
);
$this->Email->delivery = 'smtp';
$this->Email->from = "[email protected]";
$this->Email->to = "[email protected]";
$this->Email->subject = "Subject";
$this->Email->sendAs = 'html';
$this->Email->lineLength = 255;
$body = "<h1>This is body</h1>";
$this->Email->send($body);
이메일을 보내거나 오류를 표시하지 않습니다.
누락 된 것이 있습니까? 내가 올바르게 기억
감사
체크 아웃 구글 계정을 활성화? – Sergey