Separate SMTP e-mail for each in Mutli-Company

Good day,
I’ve setup 2 companies (each have their own accounts@ mailbox).
In Invoice Ninja v5, however, in the .env file we only have the option to use one “MAIL_FROM_ADDRESS”

Is there a way for each company in a Multi-company setup to use their own mailbox settings?
Thanks in advance.

Hi,

I don’t believe this is supported yet.

cc @david in case I’m wrong…

Hi,

Same problem here. If you want a temporary/hacky workaround until the devs add this functionality, and you have the same mail server hosting the different domains, the following has worked for us:

I’ve changed the following line of code in app/Mail/TemplateEmail.php:

(Line 81)
From:
$this->from(config(‘mail.from.address’), $this->company->present()->name());

To:
$this->from($settings->reply_to_email,$settings->reply_to_name);

This sends our invoices from the reply-to email and reply-to name under Settings > Email Settings.

Again, only works because our SMTP credentials (username and password) are the same for the different domains we use. Also only tested on sending invoices - there may be other references in other files for different emails the system sends out.

1 Like

Thank you so much! Will give that a go :slight_smile: