I'm using docker. I have 4 containers, in one of these I created the cronjob file and in the compose file i used "link: mysql", which is another container where my db is running. This is my cron-job.
* * * * * cd /var/www/html; /usr/local/bin/php mailscheduler.php >> /var/log/cron.log
# An empty line is required at the end of this file for a valid cron file.
In cron.log the output is always: 
In EmailModel.php I added these constant:
define('DB_SERVER', getenv()["DB_HOST"]);
define('DB_USERNAME', getenv()["DB_USER"]);
define('DB_PASSWORD', getenv()["DB_PASS"]);
define('DB_DATABASE', getenv()["DB_NAME"]);
From CLI of cron-job container it gives me no error. I don't understand what i have to do.