Questions re scheduled emails
I've set up an email form with a trigger of 'before page load' and have also set up a Cron job on our server to run the page once a day in order to send emails to selected records in the database. It all works fine, but I'm getting an error message and I also have a question about security.
Q1: I'm getting a system-generated email when the script runs which says:
PHP Notice: Undefined variable: mailContent in
/var/www/vhosts/(mydomainname)/httpdocs/webassist/email/mail_php.php on line 111 PHP Warning: date(): It is
not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the
date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you
most likely misspelled the timezone identifier. We selected 'UTC' for 'GMT/0.0/no DST' instead in
/var/www/vhosts/(mydomainname)/httpdocs/webassist/email/mail_php.php on line 189 ?>
Line 111 of that file is: $htmlEmail = $mailBody;$_SESSION[$mailRef."_Body"] = $mailContent;
Line 189 of that file is: $mailHeader .= "Date: ". date('r (T)').$lineEnd;
What changes can I make to the mail_php.php file to stop this error?
Q2: I originally had the email page protected by SecurityAssist - however it seems the server can't access it because of this. It only works if I remove the protection. Wouldn't this be a security issue though as anyone could access and run the script?