MHF
MHF

Reputation: 221

Yii2 password reset does not work

I use Windows and Yii 2.0.13.1 and xampp with php7.1.4. When logging in, I click on reset it link and i'm entering my email and send, I encounter this error:

Swift_TransportException
Process could not be started [The system cannot find the path specified. ]

My common/config/main-local.php is:

'mailer' => [
        'class' => 'yii\swiftmailer\Mailer',
        'viewPath' => '@common/mail',
        // send all mails to a file by default. You have to set
        // 'useFileTransport' to false and configure a transport
        // for the mailer to send real emails.
        'useFileTransport' => false,
],

Other settings and files are in the default mode. what is the problem? Please guide me

Upvotes: 1

Views: 859

Answers (1)

ScaisEdge
ScaisEdge

Reputation: 133380

Seems that in your config is missing the transport config
eg: using gmail.com as transport (you should choose the trasport available for your host)

    'mailer' => [
        'class' => 'yii\swiftmailer\Mailer',
        'viewPath' => '@common/mail',
        'useFileTransport' => false,//set this property to false to send mails to real email addresses

        'transport' => [
            'class' => 'Swift_SmtpTransport',
            'host' => 'smtp.gmail.com',
            'username' => '[email protected]',
            'password' => 'your_password',
            'port' => '587',
            'encryption' => 'tls',
            'streamOptions' => [
                'ssl' => [
                    'verify_peer' => false,
                    'allow_self_signed' => true
                ],
            ]
        ],

    ],

Everything is right now

Upvotes: 2

Related Questions