# SMTP server did not accept the password. on upgrade to cakephp3.6

**URL:** <https://discourse.cakephp.org/t/smtp-server-did-not-accept-the-password-on-upgrade-to-cakephp3-6/4973>\
**Category:** Uncategorized\
**Created:** [September 21, 2018, 9:16am UTC](https://discourse.cakephp.org/t/smtp-server-did-not-accept-the-password-on-upgrade-to-cakephp3-6/4973 "2018-09-21T09:16:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jagguy](https://avatars.discourse-cdn.com/v4/letter/j/b487fb/32.png) [@jagguy](https://discourse.cakephp.org/u/jagguy)\
**Post date:** [September 21, 2018, 9:16am UTC](https://discourse.cakephp.org/t/smtp-server-did-not-accept-the-password-on-upgrade-to-cakephp3-6/4973/1 "2018-09-21T09:16:45Z")

</div>

I upgraded my cakephp3.2 to cakephp3.6 . The emailing function doesnt work and i copied the same code in app file from the working emails in cakephp3.2 to the app file in cakephp3.6. The passwords exist and work fine. I edited them here for security. What has changed in 3.6?

It says the “SMTP server did not accept the password.”

i also have the allow less secure apps turned on. I cant email with this setup?

```
       //in model 
        public function sendemail($to,$from,$subject,$message) {
                     $to='xxxx@gmail.com';
                     $Email = new Email('default');
                 // $Email->config('gmail3'); 
                    $Email->from(['xxx@gmail.com' => 'My Email'])
                      ->to($to)
                      ->subject($subject)
                      ->send($message);
       
  }//public

//in app file

'EmailTransport' => [
    'default' => [
          'className' => 'Smtp',
        'host' => 'ssl://smtp.gmail.com',
        'port' => 465,
        'username'=>'xx@gmail.com',
        'password'=>'xx',
         'log' => true,
     'context' => [
         'ssl' => [
             'verify_peer' => false,
             'verify_peer_name' => false,
             'allow_self_signed' => true
          ]
         ]
    ],
  ],

  
'Email' => [
    'default' => [
        'transport' => 'default',
        'from' => 'xx@gmail.com',
        //'charset' => 'utf-8',
        //'headerCharset' => 'utf-8',
    ],
],
```
