This topic is locked

Email Settings

9/6/2017 5:29:00 PM
PHPRunner General questions
T
thudsen author

I've completed my project of a clinical record system which is working brilliantly - thanks to Sergey for an excellent piece of kit with great security settings.
I have one final goal which will make this perfect. I would prefer to use a certain type of email account for password reminders. At present I'm using a google account but I would prefer to use out institutional secure accounts for email. The challenge is that the password for these email accounts must be changed every 3 months - meaning I'd have to republish the project every 3 months to make the password reminders work.
I'm aware the settings are in appsettings.php
Is there anyway this could be updated via the published application?
Thanks
Terry

admin 9/7/2017

Add the following code to AfterAppInit and modify those settings based on your app logic:

$globalSettings["strSMTPUser"] = "";

$globalSettings["strSMTPServer"] = "localhost";

$globalSettings["strSMTPPort"] = "25";

$globalSettings["strSMTPPassword"] = "";

$globalSettings["strFromEmail"] = "";
T
thudsen author 10/19/2017



Add the following code to AfterAppInit and modify those settings based on your app logic:

$globalSettings["strSMTPUser"] = "";

$globalSettings["strSMTPServer"] = "localhost";

$globalSettings["strSMTPPort"] = "25";

$globalSettings["strSMTPPassword"] = "";

$globalSettings["strFromEmail"] = "";



Thanks for this. However, it still required republishing the app everytime the password changes on the email address (by default it forces a change every 30 days). Can the information be held in a database?
Terry

admin 10/19/2017

Of course, you an modify this code to read data from the database and still assign it to these variables.
If you use PHPRunner 9.8 use Database API:

https://xlinesoft.com/phprunner/docs/db_query.htm
In older versions you can use CustomQuery function:

https://xlinesoft.com/phprunner/docs/customquery.htm