Skip to content
This repository has been archived by the owner on Jun 1, 2022. It is now read-only.

Unknown Property Send Email #1

Closed
tecnoterabyte opened this issue Sep 9, 2018 · 4 comments
Closed

Unknown Property Send Email #1

tecnoterabyte opened this issue Sep 9, 2018 · 4 comments
Labels

Comments

@tecnoterabyte
Copy link

Q A
Yii version 3.0
Yii SwiftMailer version 3.0
PHP version 7.1.17
Operating system Centos 7

I managed to send the email simply by modifying yiisoft / yii-swiftmailer / src / Mailer.php change:

Use Yii -->use yii\helpers\Yii;
2018-09-09 11:15:13 [190.142.101.156][-][d980531faf8f8b16264f6c762dab3ae3][error][yii\exceptions\UnknownPropertyException] yii\exceptions\UnknownPropertyException: Getting unknown property: yii\web\Application::mailer in /home/example.com/public_html/vendor/yiisoft/core/src/base/Component.php:157
Stack trace:
#0 /home/example.com/public_html/vendor/terabytesoft/app/src/views/site/contact.php(50): yii\base\Component->__get('mailer')
#1 /home/example.com/public_html/vendor/yiisoft/view/src/view/View.php(324): require('/home/app.cjtte...')
#2 /home/example.com/public_html/vendor/yiisoft/view/src/view/View.php(246): yii\view\View->renderPhpFile('/home/app.cjtte...', Array)
#3 /home/example.com/public_html/vendor/yiisoft/view/src/view/View.php(145): yii\view\View->renderFile('/home/app.cjtte...', Array, Object(terabytesoft\app\controllers\SiteController))
#4 /home/example.com/public_html/vendor/yiisoft/core/src/base/Controller.php(382): yii\view\View->render('contact', Array, Object(terabytesoft\app\controllers\SiteController))
#5 /home/example.com/public_html/vendor/terabytesoft/app/src/controllers/SiteController.php(144): yii\base\Controller->render('contact', Array)
#6 /home/example.com/public_html/vendor/yiisoft/core/src/base/InlineAction.php(57): terabytesoft\app\controllers\SiteController->actionContact()
#7 /home/example.com/public_html/vendor/yiisoft/core/src/base/Controller.php(160): yii\base\InlineAction->runWithParams(Array)
#8 /home/example.com/public_html/vendor/yiisoft/core/src/base/Module.php(542): yii\base\Controller->runAction('contact', Array)
#9 /home/example.com/public_html/vendor/yiisoft/yii-web/src/Application.php(94): yii\base\Module->runAction('site/contact', Array)
#10 /home/example.com/public_html/vendor/yiisoft/core/src/base/Application.php(525): yii\web\Application->handleRequest(Object(yii\web\Request))
#11 /home/example.com/public_html/public/index.php(11): yii\base\Application->run()
#12 /home/example.com/public_html/public/index.php(12): {closure}()
#13 {main}
@hiqsol
Copy link
Member

hiqsol commented Sep 9, 2018

PR?

@tecnoterabyte
Copy link
Author

I have not sent the PR because when making the change of:

yii\helpers\Yii;

The error remains, although if you send in the mail.

@terabytesoftw
Copy link
Member

@hiqsol Ready the PR, problem fixed,

Thks,

@hiqsol
Copy link
Member

hiqsol commented Sep 17, 2018

Thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants