I am using gmail account with username and password is exactly.My gmail account status is ok.
Then:
Yii::$app->mail->compose()
->setFrom('somebody@domain.com')
->setTo('myemail@yourserver.com')
->setSubject('Email sent from Yii2-Swiftmailer')
->setTextBody('content')
->send();
But it has error 500.I can not sent mail.Why is the issue?Anybody has any ideas?Thanks
I have checked log but i haven’t found any error or warning.But on web browser i see to have 1 error ‘Failed to load resource: the server responded with a status of 500 (Internal Server Error)’.
If if i comment code lines relate to mail, everything is ok.