Yii Framework Forum: Swiftmailer error log - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Swiftmailer error log [canceled]

#1 User is offline   tklustig 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 400
  • Joined: 20-April 17
  • Location:Hannover

Posted 03 January 2018 - 09:39 AM

Hi guys, Swiftmailer will just return Boolean if sending mail won't be succesfull
-for instance if receiver is unknown.

As I intend to protocoll my mails being sent, I'd get further informations about error.
Any ideas, how to use Swiftmailer in order to get information about sending mails in case of error(s)?
0

#2 User is offline   alrazi 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 1,546
  • Joined: 08-August 12
  • Location:Durban, South Africa

Posted 04 January 2018 - 12:13 AM

errors get logged in your @runtime/logs/app.log also if you would like to debug your email you can log your emails to file using the file transport here is a example config by default it will save your messages to @runtime/mail directory.

'mailer' => [
    'class' => 'yii\swiftmailer\Mailer',
    'useFileTransport' => true
],


http://www.yiiframew...g-and-debugging
0

#3 User is offline   tklustig 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 400
  • Joined: 20-April 17
  • Location:Hannover

Posted 04 January 2018 - 05:11 AM

View Postalrazi, on 04 January 2018 - 12:13 AM, said:

errors get logged in your @runtime/logs/app.log also if you would like to debug your email you can log your emails to file using the file transport here is a example config by default it will save your messages to @runtime/mail directory.

'mailer' => [
    'class' => 'yii\swiftmailer\Mailer',
    'useFileTransport' => true
],


http://www.yiiframew...g-and-debugging

I have read this article,of course. I need informations in this log for my database.
For instance, I have attribute in my table being filled in what kind of mailing error had occured while sending.
So, it will be more complicated,as I thought, won't it? I have to investigate file in frontend/runtime/mail respectively frontend/runtime/logs. That's a lot of effort for one single attribute Posted Image
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users