Yii2 is logging each and every mail I send as .eml file and stores into frontend\runtime\debug\mail. This folders gets very heavy and eats up all my server space. Is there anyway to stop it. I am using swift mailer.
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
'viewPath' => '@common/mail',
'transport' => [
'class' => 'Swift_SmtpTransport',
'host' => 'smtp.gmail.com',
'username' => *******,
'password' => *****,
'port' => '465',
'encryption' => 'ssl',
],
],
This is happening because you have got yii2-debug module switched on. You need to remove it from production server - this is designed to be used only with non-production environments for testing and debugging.