Skip to content

log message not send email with mail components #3101

@gimox

Description

@gimox

hi.
i configured mail components with extension swift, it work good, but it ca not send log email with this components. Mail with swift components work perfects.

This is my configuration

'mail' => [
                                                 'class' => 'yii\swiftmailer\Mailer',
                                                 'transport' => [
                                                                    'class'         => 'Swift_SmtpTransport',
                                                                    'host'          => 'smtp.gmail.com',
                                                                    'username'      => 'myemail@gmail.com',
                                                                    'password'      => 'password',
                                                                    'port'          => '465',
                                                                    'encryption'    => 'ssl',
                                                                ],
                                                ],


                                    'log' => [
                                                  'traceLevel' => YII_DEBUG ? 3 : 0,

                                                   'targets' => [  
                                                            'file'=> [
                                                                            'class' => 'yii\log\FileTarget',
                                                                            'levels' => ['error', 'warning'],
                                                                      ],


                                                                  'email' => [
                                                                     'class' => 'yii\log\EmailTarget',
                                                                     'mail' =>'mail',
                                                                     'levels' => ['error', 'warning'],
                                                                      'message' => [
                                                                                    'to' => ['adress1@gmail.com', 'address2@gmail.com'],
                                                                                    'subject' => ' Frontend LOG',
                                                                                    ],
                                                                   ],
                                                                 ], 
                                              ],

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions