The email wiki refers to several parameters in the globals.php file that need to be modified, specifically:
$GLOBALS - email outgoing server host/ip
$GLOBALS - email outgoing server port
$GLOBALS - if to use ssl
$GLOBALS - local host name used to send email
$GLOBALS - outgoing server user
$GLOBALS - outgoing server password
In searching the forums, there seemed to be one post which suggested that the globals.php file had been modified to reflect the wiki instructions, but I’m not seeing it. I am using 3.1 with patch #5 installed.
What is the correct format for adding these parameters? Should I just, for example, add:
$GLOBALS (as well as the other lines) to the bottom of the globals.php file? (smtp.myhost.com being my smtp server)
To add variables for the smtp:
$GLOBALS = ‘smtp.broadband.rogers.com’;
$GLOBALS = ‘25’;
$GLOBALS = ‘wooyi@rogers.com’;
$GLOBALS = ‘password’;
I am looking at this feature at the moment because I’m integrating an automatic phone reminder service to OpenEMR using a similar approach to the email reminders.
I did not find the Admin interface for the Notifications as described in the Wiki, but you can configure this by manually updating the automatic_notification table in the database to update the sender’s email and the email message title, body you want sent out. I got it to work after I updated this table.
Thanks for your help! I modified globals.php. Now I’m getting an error message that there is trouble communicating with the email server. I’ll look at ports and firewalls first, before I try anything esoteric.
If it’s not your firewall, it could be your ISPs. ISPs routinely close port 25 to avoid people sending out spam. You can use telnet to test your connection:
Another good call, wooyi. port was locked off, so I checked with my host, found I could use port 587. That worked with telnet, but I’m still getting the same response from OpenEMR. It looks like this:
xl(‘Could not send email due to a server problem, ‘,’’,’
). 5 . xl(’ emails not sent’,’’,’’,’
')
If using gmail (587 is common for them) you need to import their certficate. Try this How to for sending email through GMAIL. I have used it to send email via the command line or scripts.
btw, after looking at the cron scripts in the sms_email_reminder module and there are some significant bugs in there. The function that queries for appointments from the calender, for example, is not correct and will result in weird behavior. It does not calculate the “forward” date correctly.
Recently upgraded one practice to 4.0 which broke the email process. Here is the Cron Daemon’s message when running cron_email_notification.php :
Warning: include_once(…/…/interface/globals.php): failed to open stream: No such file or directory in /var/www/openemr/modules/sms_email_reminder/cron_email_notification.php on line 18
Warning: include_once(): Failed opening ‘…/…/interface/globals.php’ for inclusion (include_path=’.:/usr/share/php:/usr/share/pear’) in /var/www/openemr/modules/sms_email_reminder/cron_email_notification.php on line 18
Fatal error: Call to undefined function sqlFetchArray() in /var/www/openemr/modules/sms_email_reminder/cron_functions.php on line 349
Is there a patch / fix or did we miss a configuration step?
This is an issue I have noted when trying to do command line scripts within OpenEMR since the multisite feature was added. Will need to either bring in the site parameter into this script (either as a parameter or hard-code it) and set it equal to $_SESSION near the beginning (before the call to globals.php) of the script.
Hi,
Somebody needs to incorporate the fix outlined in above post (post 10) to get these scripts to work when called via command line. Bringing the site_id in as a parameter seems like the best way.
-brady OpenEMR
To provide a bit more details, try placing the following code above the include_once("…/…/interface/globals.php"); line:
$_GET = ‘default’;
This will hard-code the site in. Note it will break if using multisite module or if using something other than default at openemr/sites/* . The proper way to do this (so it works in both command line mode and php mode) is to collect a parameter (and only if the parameter exists, then set it to that).
could you help me fix it please? because i followed all indication and still receive the same error “PHP Notice: Undefined index: HTTP_HOST in /var/www/html/openemr/interface/globals.php on line 107
Site ID ‘’ contains invalid characters.”
and it doesn’t send any emails to remembers appointment patients, here is the log problem but i don’t know which code i put inside to fix it.