I'm sending an email using CakePHP and I got an Error: SMTP server did not accept the password
, along with an email in my inbox says that: sign-in attempt blocked! , we recently blocked a sign-in attempt to your Google Account
.
Is that normal?
I'm using Xampp.
function sendActivationEmail($user_id)
{
Debugger::dump($user_id);
$user = $this->User->findById($user_id);
if ($user==false)
{
debug(__METHOD__." failed to retrieve User data for user.id: {$user_id}");
return false;
}
$this->set('username', $this->data['User']['username']);
$this->Email->to = $user['User']['email'];
$this->Email->subject = env('SERVER_NAME').'- Please confirm your email address';
$this->Email->from = '[email protected]';
$this->Email->template = 'account_verification';
$this->Email->delivery = 'smtp';
$this->Email->smtpOptions = array(
'port'=>'465',
'timeout'=>'30',
'host' => 'ssl://smtp.gmail.com',
'username'=>'[email protected]',
'password'=>1234567
);
$this->Email->sendAs = 'text';
return $this->Email->send();
}