Not sending emails/invoices

Hello all,
I am using IN 5.3.76-C77 on shared hosting deployed by softaculous.
No matter what, I cannot make the system to send emails and also I cannot get rid of the error saying that Cron jobs not running.

Cron jobs are running on my server and have double checked with the hosting company.

My env file is as follows:

APP_NAME=“Invoice Ninja”
APP_ENV=production
APP_KEY=my domain.com
APP_DEBUG=“true”

APP_URL=“https://my domain.com/public

DB_CONNECTION=“mysql”
MULTI_DB_ENABLED=false

DB_HOST=“localhost”
DB_DATABASE="dbname "
DB_USERNAME=“db username”
DB_PASSWORD=“Password”
DB_PORT=“3306”

DEMO_MODE=false

BROADCAST_DRIVER=log
LOG_CHANNEL=stack
CACHE_DRIVER=file
QUEUE_CONNECTION=database (I have tried with sync without any success)
SESSION_DRIVER=file
SESSION_LIFETIME=120

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=“smtp”
MAIL_HOST=“smtp.office365.com
MAIL_PORT=“587”
MAIL_USERNAME="myemail@domain.com"
MAIL_PASSWORD=“email-app-password”
MAIL_ENCRYPTION=“tls”
MAIL_FROM_ADDRESS="myemail@domain.com"
MAIL_FROM_NAME=“name-Finance”

When I send an email I.e. to a new user I get a pop up saying an email was send but I never receive anything.

No errors are produced, only in the db jobs table I can see some.
Here is one of these errors:

{“uuid”:“4cc3aaef-2000-449e-aa9e-92f1d2831781”,“displayName”:“App\Listeners\Activity\CreatedClientActivity”,“job”:“Illuminate\Queue\CallQueuedHandler@call”,“maxTries”:null,“maxExceptions”:null,“failOnTimeout”:false,“backoff”:null,“timeout”:null,“retryUntil”:null,“data”:{“commandName”:“Illuminate\Events\CallQueuedListener”,“command”:“O:36:“Illuminate\Events\CallQueuedListener”:19:{s:5:“class”;s:44:“App\Listeners\Activity\CreatedClientActivity”;s:6:“method”;s:6:“handle”;s:4:“data”;a:1:{i:0;O:34:“App\Events\Client\ClientWasCreated”:3:{s:6:“client”;O:45:“Illuminate\Contracts\Database\ModelIdentifier”:4:{s:5:“class”;s:17:“App\Models\Client”;s:2:“id”;i:1;s:9:“relations”;a:5:{i:0;s:7:“company”;i:1;s:14:“group_settings”;i:2;s:4:“user”;i:3;s:8:“contacts”;i:4;s:15:“primary_contact”;}s:10:“connection”;s:5:“mysql”;}s:7:“company”;O:45:“Illuminate\Contracts\Database\ModelIdentifier”:4:{s:5:“class”;s:18:“App\Models\Company”;s:2:“id”;i:1;s:9:“relations”;a:0:{}s:10:“connection”;s:5:“mysql”;}s:10:“event_vars”;a:4:{s:2:“ip”;s:13:“80.107.26.107”;s:5:“token”;s:64:“OBDiErIt7uhEp5e4yBlM8rlxAvGaokuLtMYIcJaOvrs4eHdPU0pxfaz8S4nOp0Of”;s:9:“is_system”;b:0;s:7:“user_id”;i:1;}}}s:5:“tries”;N;s:13:“maxExceptions”;N;s:7:“backoff”;N;s:10:“retryUntil”;N;s:7:“timeout”;N;s:17:“shouldBeEncrypted”;b:0;s:3:“job”;N;s:10:“connection”;N;s:5:“queue”;N;s:15:“chainConnection”;N;s:10:“chainQueue”;N;s:19:“chainCatchCallbacks”;N;s:5:“delay”;N;s:11:“afterCommit”;N;s:10:“middleware”;a:0:{}s:7:“chained”;a:0:{}}”},“db”:“mysql”}

Any suggestions?
Many thanks

Hi,

@david any thoughts?

I would suggest first putting the QUEUE_CONNECTION to sync and then running /update?secret=secret

This will remove queues and should fire the email job inline.

You could also turn on debug temporarily to see what the problem is, in the .env set APP_DEBUG=true

and then run /update?secret=secret

Good morning and thank you for your help.

App debug is already true but not producing any errors. The system logs are empty as well.

When I change the queue connection to sync, the system is slower, i still get the message ‘An email has been sent to confirm the email address’ but i don’t receive anything. When i do a health check i get a warning Queue not enabled.

Re smtp and email settings, i use MS365, i have set it to allow all apps and an App password has been setup for IN.

The cron job i have setup is running every minute cd /home/user/invoice.domain.com/public && /usr/bin/php -d register_argc_argv=On artisan schedule:run >> /dev/null 2>&1

I have about 80 logs in the database jobs. Do you want me to share them with you somehow?

Hello,
I am in the same situation, no emails are sent despite that I use InvoiceNinja to remind my clients to pay for invoices 60, 30, 15, 7, 3 days before payment. I upgrade regularly, now using v5.3.78-L77. This started to happens since january I guess. I cannot tell you exactly when, because there is no log about sending emails.
Yesterday I deleted ’laravel.log’. Today, I used the send email to remind a client for an invoice.
I saw the notification that an email has been send, but the log file is still empty. And looking in the hisorique and activity sections are both empty. I confirm that APP_DEBUG=“true”.

Any help would be greatly appreciated.
Thanks.
Best regards.
John

Hello,
I did some online research and it seems that Microsoft is deprecating basic and legacy authentication. I created a new no-reply email account on my cpanel and used that to send emails with Invoice Ninja and now it works. Not sure why it is not working with the MS account or why it is not producing any errors.
I am using the very same account for other apps and they do work.

The cron job error at the bottom left hand side is still there though. Any thoughts how i can fix this?

It may help to log the output of the cron to ensure it’s working correctly or try running it from the command line.

So I ran the cron from the command line and this time, all the emails went by.
I’m on a shared hosting and I tried to configure the cron with these 2 different methods.

* * * * * cd /path-to-your-project && php artisan schedule:run >> path-to-your-project/storage/logs/laravel.log 2>&1
* * * * * php /path-to-your-project/artisan schedule:run >> path-to-your-project/storage/logs/laravel.log 2>&1

So this is the output for both:

Laravel Framework 8.83.6

Usage:
command [options] [arguments]

Options:
-h, --help            Display help for the given command. When no command is given display help for the list command
-q, --quiet           Do not output any message
-V, --version         Display this application version
    --ansi|--no-ansi  Force (or disable --no-ansi) ANSI output
-n, --no-interaction  Do not ask any interactive question
    --env[=ENV]       The environment the command should run under
-v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
clear-compiled               Remove the compiled class file
completion                   Dump the shell completion script
db                           Start a new database CLI session
down                         Put the application into maintenance / demo mode
env                          Display the current framework environment
help                         Display help for a command
inspire                      Display an inspiring quote
list                         List commands
migrate                      Run the database migrations
optimize                     Cache the framework bootstrap files
serve                        Serve the application on the PHP development server
test                         Run the application tests
tinker                       Interact with your application
up                           Bring the application out of maintenance mode
auth
auth:clear-resets            Flush expired password reset tokens
cache
cache:clear                  Flush the application cache
cache:forget                 Remove an item from the cache
cache:table                  Create a migration for the cache database table
config
config:cache                 Create a cache file for faster configuration loading
config:clear                 Remove the configuration cache file
countries
countries:migration          Creates a migration following the Laravel-countries specifications.
db
db:seed                      Seed the database with records
db:wipe                      Drop all tables, views, and types
debugbar
debugbar:clear               Clear the Debugbar Storage
event
event:cache                  Discover and cache the application's events and listeners
event:clear                  Clear all cached events and listeners
event:generate               Generate the missing events and listeners based on registration
event:list                   List the application's events and listeners
key
key:generate                 Set the application key
l5-swagger
l5-swagger:generate          Regenerate docs
make
make:cast                    Create a new custom Eloquent cast class
make:channel                 Create a new channel class
make:command                 Create a new Artisan command
make:component               Create a new view component class
make:controller              Create a new controller class
make:event                   Create a new event class
make:exception               Create a new custom exception class
make:factory                 Create a new model factory
make:job                     Create a new job class
make:listener                Create a new event listener class
make:mail                    Create a new email class
make:middleware              Create a new middleware class
make:migration               Create a new migration file
make:model                   Create a new Eloquent model class
make:notification            Create a new notification class
make:observer                Create a new observer class
make:policy                  Create a new policy class
make:provider                Create a new service provider class
make:request                 Create a new form request class
make:resource                Create a new resource
make:rule                    Create a new validation rule
make:seeder                  Create a new seeder class
make:test                    Create a new test class
migrate
migrate:fresh                Drop all tables and re-run all migrations
migrate:install              Create the migration repository
migrate:refresh              Reset and re-run all migrations
migrate:reset                Rollback all database migrations
migrate:rollback             Rollback the last database migration
migrate:status               Show the status of each migration
model
model:prune                  Prune models that are no longer needed
module
module:delete                Delete a module from the application
module:disable               Disable the specified module.
module:dump                  Dump-autoload the specified module or for all module.
module:enable                Enable the specified module.
module:install               Install the specified module by given package name (vendor/name).
module:list                  Show list of all modules.
module:make                  Create a new module.
module:make-command          Generate new Artisan command for the specified module.
module:make-component        Create a new component-class for the specified module.
module:make-component-view   Create a new component-view for the specified module.
module:make-controller       Generate new restful controller for the specified module.
module:make-event            Create a new event class for the specified module
module:make-factory          Create a new model factory for the specified module.
module:make-job              Create a new job class for the specified module
module:make-listener         Create a new event listener class for the specified module
module:make-mail             Create a new email class for the specified module
module:make-middleware       Create a new middleware class for the specified module.
module:make-migration        Create a new migration for the specified module.
module:make-model            Create a new model for the specified module.
module:make-notification     Create a new notification class for the specified module.
module:make-policy           Create a new policy class for the specified module.
module:make-provider         Create a new service provider class for the specified module.
module:make-request          Create a new form request class for the specified module.
module:make-resource         Create a new resource class for the specified module.
module:make-rule             Create a new validation rule for the specified module.
module:make-seed             Generate new seeder for the specified module.
module:make-test             Create a new test class for the specified module.
module:migrate               Migrate the migrations from the specified module or from all modules.
module:migrate-refresh       Rollback & re-migrate the modules migrations.
module:migrate-reset         Reset the modules migrations.
module:migrate-rollback      Rollback the modules migrations.
module:migrate-status        Status for all module migrations
module:publish               Publish a module's assets to the application
module:publish-config        Publish a module's config files to the application
module:publish-migration     Publish a module's migrations to the application
module:publish-translation   Publish a module's translations to the application
module:route-provider        Create a new route service provider for the specified module.
module:seed                  Run database seeder from the specified module or from all modules.
module:setup                 Setting up modules folders for first use.
module:unuse                 Forget the used module with module:use
module:update                Update dependencies for the specified module or for all modules.
module:use                   Use the specified module.
module:v6:migrate            Migrate laravel-modules v5 modules statuses to v6.
ninja
ninja:backup-update          Shift backups from DB to storage
ninja:check-data             Check/fix data
ninja:check-db               Check MultiDB
ninja:create-account         Create Single Account
ninja:create-single-account  Create Single Sample Account
ninja:create-test-data       Create Test Data
ninja:demo-mode              Setup demo mode
ninja:design-update          Update the system designs when changes are made.
ninja:import                 Import a v4 migration file
ninja:mobile-localization    Generate mobile localization resources
ninja:old-import             Massively import the migrations.
ninja:pcheck-data            Check company data in parallel
ninja:post-update            Run basic upgrade commands
ninja:s3-cleanup             Remove orphan folders/files
ninja:send-recurring         Sends the recurring invoices
ninja:send-reminders         Force send all reminders
ninja:send-test-emails       Sends Test Emails to check templates
ninja:subdomain              Pad subdomains
ninja:sync-users             Syncs Invoice Ninja Users
ninja:translations           Transform translations to json
notifications
notifications:table          Create a migration for the notifications table
optimize
optimize:clear               Remove the cached bootstrap files
package
package:discover             Rebuild the cached package manifest
queue
queue:batches-table          Create a migration for the batches database table
queue:clear                  Delete all of the jobs from the specified queue
queue:failed                 List all of the failed queue jobs
queue:failed-table           Create a migration for the failed queue jobs database table
queue:flush                  Flush all of the failed queue jobs
queue:forget                 Delete a failed queue job
queue:listen                 Listen to a given queue
queue:monitor                Monitor the size of the specified queues
queue:prune-batches          Prune stale entries from the batches database
queue:prune-failed           Prune stale entries from the failed jobs table
queue:restart                Restart queue worker daemons after their current job
queue:retry                  Retry a failed queue job
queue:retry-batch            Retry the failed jobs for a batch
queue:table                  Create a migration for the queue jobs database table
queue:work                   Start processing jobs on the queue as a daemon
route
route:cache                  Create a route cache file for faster route registration
route:clear                  Remove the route cache file
route:list                   List all registered routes
schedule
schedule:clear-cache         Delete the cached mutex files created by scheduler
schedule:list                List the scheduled commands
schedule:run                 Run the scheduled commands
schedule:test                Run a scheduled command
schedule:work                Start the schedule worker
schema
schema:dump                  Dump the given database schema
session
session:table                Create a migration for the session database table
storage
storage:link                 Create the symbolic links configured for the application
stub
stub:publish                 Publish all stubs that are available for customization
vendor
vendor:publish               Publish any publishable assets from vendor packages
view
view:cache                   Compile all of the application's Blade templates
view:clear                   Clear all compiled view files
X-Powered-By: PHP/8.0.17
Content-type: text/html; charset=UTF-8