Email , mercury mail, servers

arnabnaha wrote on Saturday, October 09, 2010:

Hi…
1.please help me setup mercury mail to send email from the openemr about patient appointment.
2.It will be of great help if anybody can tell me the procedure to send mail using batchcom…as i was unable to get any clear answer from the forum. where to enter the email setting in the global file? what should be the changes the php.ini file so that i can send emails right from the openemr automatically as i make an appointment.
3. i am also unable to send mail to a pharmacy after adding a prescription…it says " could not instantiate the mail function". what could be the problem and what is its solution?
4. I prepared a cron job in windows (by task scheduler manually) to run the cron_email_notification.php file…but still i was unable to send email alerts /reminders to patient regarding appointments.
5. i have set up the mercury mail and i am able to send mail manually to my gmail account/any gmail account, but i want to integrate it with openemr, so that i can automatically send emails…how to do that?
6. Any alternate ways of sending email automatically from openemr???

blankev wrote on Saturday, October 09, 2010:

To set up Mercury mail, possible solution might be found at:

http://www.tech2all.com/2006/03/12/how-to-setup-your-own-e-mail-server/

Or you could do a search for Pegasus mail David Harris mercury mail server

Good Luck,

Pimm

arnabnaha wrote on Sunday, October 10, 2010:

Thanks Pimm

I want to integrate it wilh openemr, so that i can send mails automatically. please help me with that.

blankev wrote on Sunday, October 10, 2010:

Dear Arnbnaha,

Mercury is integrated in XAMPP. But is not activated by default. So most probably, with my knowledge of the structure of OpenEMR, it is already integrated and can be used with some changes in Globals,or PHP.in, some of the more experienced programmers (the long time developers who were active in V 2.2 or earlier, might show you the more appropriate ways. It should be rather easy, to connect without to much trouble, to use  Mercury.

Pls keep me informed since I am also a WindowsXP user of OpenEMR and do not know much about integration and I am very much interested in sending e-mails to my clients, referrers, pharmacies etc…

You can find Mercury and all files under:

xampp/MercuryMail/Mercury

I do remember that  some years ago, the good bad days that XAMPP was not yet integrated in the installation of OpenEMR I did get it working in the official XAMPP installation part, and I did send mails through Mercury. XAMPP is a very versatile program to connect through Server and PHP programming. Although (Mercury and) Pegasus mail are not maintained anymore, the latest version has so many options that it still is my favorite. Pegasus has now a mail option for SPAM and due to the fact it is rather unkown and not automatically included not a real target for Virusses.

Pimm

arnabnaha wrote on Sunday, October 10, 2010:

hi pimm

do you remember those configuration changes in the php.ini files and the globals.php file? also we need to set up the mercury mail to send mail from the localhost. can you send me the steps to setup pegasus mail and mercury mail to send mails from the localhost?

blankev wrote on Sunday, October 10, 2010:

That is my problem, it is too long ago that I did try it. Buit then OpenEMR was not good enough to use it in daily practice on Curacao. But now it is so extensive that OpenEMR is my favorite

Let me know what steps you took and than I will try to duplicate and working together we will find the solution.

Pimm

arnabnaha wrote on Monday, October 11, 2010:

hi pimm
Set up of Mercury Mail
1. opened the programme by double clicking “loader” application in my C:\Xampp\mercury Mail\ folder.
2. from configuration tab in the window of mercury mail, clicked on Protocol modules.
3. A window called “Select Active protocol Modules” open up
4. Deselect MercuryE SMTP end to end delivery client. Select Mercury C SMTP relaying Client. Also Deselect Mercury IMAP4rev1 server and Mercury B HTTP web server. (I did these as i found them in a tutorial on google search.)
5. Press Ok in that window. Please restart your apache….its a must.
6. now…from the configuration tab, click on " Mercury Core Module Configuration"
7. In the new window that pops, enter localhost for -Internet name for this system, only keep “send copies of all errors to the post master” selected and deselect all other , select the time zone, keep username of postmaster as Admin.
8. Go to the Local domains tab in the same window…
9. In the local domains tab, you should have localhost as " Localhost or server" and localhost as " internet Name" in the list given. if there are no list, then just add domain with the above credentials.
10. Click ok.
11. From the configuration tab click on MERCURY SMTP SERVER
12. in the new window, type- Anounce my self  as -127.0.0.1, IP Interface to use - 127.0.0.1, Listen on TCP/IP Port - 25, keep all other default settingas it is…form the check boxes below, select only " display session progress and debugging information" and the rest should remain as deselected.
13. click on the CONNECTION CONTROL tab.
14. Click on Add Restriction
15. type the IP range as - 127.0.0.1 to 127.0.0.1 (so that only this computer uses it). click on allow connections in the attributes. and press OK leaving everything else as default.
16. In the relaying control options just below add restriction button, only select " Do not permit SMTP relaying of non-local mail" and leave others deselected…
17. Click ok.
18. From the configuration tab, inthe main window, click on Mercuru POP3 Server.
19. in the new window that opens, Type- TCP PORT = 110, IP Interface - 127.0.0.1. keep others as default.
20. Click on connection control tab, and do the same thing as done in setting up the SMTP server.
21. Click OK
22. From the configuration tab, click on Mercury SMTP Relay Client.
23. in the new window,  type: SMART HOST NAME = smtp.gmail.com, Connection type/port: 465, SSL encryption using direct connection (this setting was required to send mails to gmails, i dont know what to do for the local host and openemr)
24. Gibe the gredentials for SMTP authorisation, Login user name: aaa@gmail.com ,password: pppppppp
25. Click OK
26. from the configuration tab, click on Mercury POP client
27. leave everything default, only click add  under pop3 account information space
28. In the new window that opens on clicking add, write POP3 host as pop.gmail.com, username: aaa@gmail.com, password pppppp (your gmail password). TCP/ip port 110, normal (No SSL Encryption)
29. Click ok
30. Click Save.
31. In C:\Xampp\php open the php configuration file
32. under mail function, write : SMTP=localhost, smtp_port = 25 and sendmail_from = postmaster@localhost
33. save the php configuration file.
34. In the mercury window, click on file
35. click on Sen mail message…
36. in the new window, fill out the to : with email address of the recepient, a subject and a body
37. click send.
38.your message will be deliverd

This is all i did to send mail…but i cant send mail from the openemr interface…what should be the settings for that. even i cant send the mails automatically…its still a manual process… what to do???/ HELP please….

blankev wrote on Monday, October 11, 2010:

Did you send a mail with Mercury as is so you know it is working? If so, from here we need HELP from active Developers. Most probably the settings for sending mail from within OpenEMR V 3.2 and V 4.0 development have moved to a different  *.PHP file.

Developers:
Where can we find in OpenEMR the setiitngs to use Mercury from OpenEMR?

Hope I can find time to put your excellent steps in EMR Wiki files. These last steps are realy simple, but you have to find the right spot(s)

Pimm

blankev wrote on Monday, October 11, 2010:

Arnabnaha,

I traced the following files that could lead you to settings in OEMR important to use MercuryMail in Server setting.

At the end in OpenEMR/Interface/globals.php where you are not supposed to change things, there is an option for e-mails and SMS to be send. But it is possible that the names of these variables are configured elsewhere in OpenEMR.

C:\xampp\install\xamppserver.inc This is the place where Server connection seems to be defined. These lines in this fole seem to send you to the right MercuryMail spot.

C:\xampp\MercuryMail\MERCURY.INI seems to be the spot where to locate the e-mails to be send. All referal to PegasusMail should be pointed to the path of OpenEMR directory to send mail.

MercuryMail is a part of Xampp.

Xampp is used to let OpenEMR work in Server setting with Apache protection. So Xampp has to learn that Mercury is not supposed to look in Pegasus mail, where it originally could find its mail, but has to look in OpenEMR for the mails to be send.

So far these are spots of where change things or to look for solutions to send maisl by OpenEMR for Window Users.

PLEASE correct me “Developers” if I hit the wrong spot and correct me if necessary.

Pimm

Pimm

arnabnaha wrote on Monday, October 11, 2010:

hi pimm…

i am able to send emails to my gmail account from within the oemr by making some necessary changes in the interface/batchcom/batchemail.php file. if you need the file…give me your email address, i will send that file to you. The file was not corrected by me alone but by eldho services. i am thankful to them to help me figure out that. thanks eldho services (a part of zh health care)

all the mails are being sent to my patient’s gmail account via mercury mail ony. so no need to search for any other configuration. Please configure the mercury mail as i told you in the steps above with a slight change in step no. 16. please deselect the “Do not permit relaying of non-local mail” and it will work fine.

only the automatic notification is the one i need to work on…as in windows by running the task scheduler, i cant run the cron_email_notification.php file, though if done manually, emails are nicely sent.

so please help in properly setting up the task schedular…

blankev wrote on Monday, October 11, 2010:

And in my version 3.2 with the menu left you have to make adjustments.

Misellaneous => BatchCom

Your@example.com for sender.

Probably this file will also give other indications on where to make adjustments. This is probably not the way you wanted to send e-mails for. This uses CVS and goes through SEND MAIL by POST statement.

Pimm

arnabnaha wrote on Monday, October 11, 2010:

ya…batchcom is not very useful…you can populate the automatic_notification table in the database and run the file cron_email_notification.php to send appointment reminders to all the patients in a go. thats useful…but the problem with that is its still not working automatically. i need to setup task manager properly to setup this thing to work automatically.

blankev wrote on Monday, October 11, 2010:

Sorry for this crossing of problems solving. Given time I will start working on the changes.

Pimm

arnabnaha wrote on Monday, October 11, 2010:

hey…nothing to be sorry about it…you need to help me setting up the task scheduler to setup everything automatically…

blankev wrote on Tuesday, October 12, 2010:

Activation of Cron jobs might be found in:

C:\xampp\htdocs\openemr\modules\sms_email_reminder

in that same directory is a readme.txt that might give some advise of where to go.

But that goes far beyond my capabilities of implementing changes. Hope to get the steps to make, once you found a solution.

Please send me the file offered to:

pimmblankevoort at hotmail dot com

Tnx in advance, Pimm

I know this post is very old. But I got to the same situation. I don’t know how to configure openemr for automatic notifications. I was able to run the mail cron with the task scheduler. but I don’t know how to fill the automatic submission table or how to configure the global parameters. the mercury is working well.
regards