Mail configuration & testing

Hi there, I’m trying to troubleshoot mails not sending from my installation.

To test the system, I’ve created a quote, and I’m trying to send the quote via email to myself.

First thing : when I’m applying changes to the .env file, does refreshing the page of my Invoice Ninja in my browser is enought to update the system with the new configuration in the .env file ? or I need to do something more fancy, like “php artisan optimize”…

I’ll post after that with the configuration troubleshooting if I’m not able to do it alone…

Thanks !

Hi,

If you’re using the latest version of the app you shouldn’t need to run optimize.

In the Flutter app you can use the health check option in the about dialog to check that your changes are taking effect.

Thank you for your reply.

Yes, using the latest version. I’ve effectively check the Health Check to see if changing smtp to mailgun was reflected after just a refresh, and it is. So I can conclude that any other changes like the port number should be updated as well.

Well, can’t make it work, so here we go :wink:

I’m also trying to troubleshoot with the hoster, no solution for the moment.

I’m on a shared hosted platform, and trying to use the selfhosted mail server, I guess we call it that.

I’m using version v5.6.0-C118, in production mode. My installation is under a subdomain (ninja.productionsxx.ca).

I’ve already checked the logs in storage > logs, but it’s empty besides a .gitignore file. Not sure if the loggin have to be turn on somewhere ?

I also don’t have any particular message in the activity or system tabs.

This is the configuration infos from my web hoster :
Paramètres SSL/TLS secured Settings (Recommended)
User Name : [email protected]
Password : use the password from your email account.
Server : node11-ca.n0c.com
Ports incoming : IMAP : 993 | POP3 : 995
Ports outgoing : SMTP : 465 / 587

And this is what I tried so far :

MAIL_MAILER=smtp
MAIL_HOST=localhost
MAIL_PORT=587
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
[email protected]
MAIL_FROM_NAME=“LES PRODUCTIONS XX”

MAIL_MAILER=smtp
MAIL_HOST=localhost
MAIL_PORT=587
MAIL_USERNAME=“[email protected]
MAIL_PASSWORD=“*************”
MAIL_ENCRYPTION=tls
[email protected]
MAIL_FROM_NAME=“LES PRODUCTIONS XX”

MAIL_MAILER=smtp
MAIL_HOST=localhost
MAIL_PORT=465
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=ssl
[email protected]
MAIL_FROM_NAME=“LES PRODUCTIONS XX”

MAIL_MAILER=smtp
MAIL_HOST=localhost
MAIL_PORT=465
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=tls
[email protected]
MAIL_FROM_NAME=“LES PRODUCTIONS XX”

MAIL_MAILER=smtp
MAIL_HOST=localhost
MAIL_PORT=587
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=tls
[email protected]
MAIL_FROM_NAME=“LES PRODUCTIONS XX”

MAIL_MAILER=smtp
MAIL_HOST=node11-ca.n0c.com
MAIL_PORT=587
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=tls
[email protected]
MAIL_FROM_NAME=“LES PRODUCTIONS XX”

MAIL_MAILER=smtp
MAIL_HOST=node11-ca.n0c.com
MAIL_PORT=465
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=tls
[email protected]
MAIL_FROM_NAME=“LES PRODUCTIONS XX”

MAIL_MAILER=smtp
MAIL_HOST=node11-ca.n0c.com
MAIL_PORT=465
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=ssl
[email protected]
MAIL_FROM_NAME=“LES PRODUCTIONS XX”

and I’m running out of inspiration…

Update : on the Web Server Provider side, they say that they don’t see anyhing that should block the communication to the local mail server, and to check with the software developer.

Update : It’s a migration that I’ve done, besides the new configuration that I’m trying to do for the mail, everything else was looking ok, but I’ve just notice that the system doesn’t log new activity. If I create a new quote in my “old” instalation (v5.5.103), activity is showing that a new quote was created or modified. It doesn’t work on my new installation, and it doesn’t help for troubleshooting I guess… and maybe it’s part of the problem with the mails. Any idea ?

Update : I’ve changed the QUEUE_CONNECTION=database to QUEUE_CONNECTION=sync
and the activity is now showing correclty. What’s the diff between the two ?

Update : and the mails are now working. So, what should I do, leave it to sync, put it back to database ? Does it have something to do with the cron jobs ?

Update : Well, I had an error in the path of my Cron Jobs, fixed that. Put back the Queue to database, all seems good now…

1 Like

I have problem again with email sending. The activity tab is working correctly on the main page, but email doesn’t get out.

@david do you have any suggestions?

I’ve put back the USERNAME and PASSWORD in the .env config file, It seems like it worked without any in my last test, but anyway, mail are working back now. I don’t know if it’s because of this, or because I’ve done a “php artisan optimize”… after modifying the .env file. I see if it sticks…

I don’t know about the log’s error though, what is it about…