Can't set my basic application to Production

Hello,

I’m trying to put my new Yii2 basic template application in production, but the emails are still getting sent to runtime folder instead of actually being sent.

I’ve commented out the following two lines in my web/index.php file


//defined('YII_DEBUG') or define('YII_DEBUG', true);

//defined('YII_ENV') or define('YII_ENV', 'dev');

But still, when I go to the contact page for a test, I still get the message


Note that if you turn on the Yii debugger, you should be able to view the mail message on the mail panel of the debugger. Because the application is in development mode, the email is not sent but saved as a file under /homepages/28/d707141912/htdocs/recyclebent/runtime/mail. Please configure the useFileTransport property of the mail application component to be false to enable email sending.

What am I missing ?

thanks a lot !

Benn

=================

EDIT : solved thanks to Deele from the live chat : it was in fact in production mode, but I didn’t understand I needed to set useFileTransport to false and configure a transport.

Hi,

Make sure the debug modules are disabled when moving to production. Navigate through the following link to know more.

https://www.yiiframework.com/doc/guide/2.0/en/concept-configurations#environment-constants