Changing SMTP server

Hi guys
So, I’ve setup invoiceninja v5 (dockerized), and entered the email server settings on the initial setup page.
I need to change the email server (SMTP) settings, however I can’t seem to find the option within the web interface.

Is there an option in the web interface or do I have to change/update it elsewhere?



You need to edit the .env file and then run php artisan optimize.

Does that mean the .env settings will override the mail server setting configured through the web interface?

I don’t understand, in v5 it isn’t possible to configure the email server through the web interface.

When setting up v5 for the first time, it let’s you configure the email server for InvoiceNinja to use.

That interface is only available when initially setting up

Yes. So the .env overwrites whatever was set on the initial setup web page.

As long as you run php artisan optimize

1 Like

Thank you for the help

Sure! FYI… we plan to add a UI to manage the .env file but it probably won’t be available for some time.


I edited the .env file that is located in the root of your INv5 install path.

Here are some example mail settings

MAIL_FROM_NAME=‘Self Hosted User’

You must include the ‘’ in mail_from_address and mail_from_name otherwise Invoice Ninja breaks.

Once you have updated the .env file

Log into Invoice Ninja

Bottom left of your screen click the info icon


Click Heath Check

Then click clear cache

1 Like

What happens if you can’t run the command due to being on shared hosting?

@david any thoughts?

I am on shared hosting and managed to run the command as a Cron job, set to run every minute then I deleted it once it had the chance to run at at least once. I used the following format:-

cd /home/???/??? && /opt/alt/php74/usr/bin/php -d register_argc_argv=On artisan optimize >> /dev/null 2>&1

It worked for me.