Copy link to clipboard
Copied
I am using the cfmail tag and am required to use a user name and password. I'd like to centralize this login information in a single place to simplify the code and allow me to change the password often. Can anyone recommend a way to do this?
Copy link to clipboard
Copied
Set the user name and password for the mail server in the mail settings in the ColdFusion Administrator.
http://livedocs.adobe.com/coldfusion/8/htmldocs/basiconfig_11.html#1139855
Copy link to clipboard
Copied
theedryden wrote:
I am using the cfmail tag and am required to use a user name and password. I'd like to centralize this login information in a single place to simplify the code and allow me to change the password often. Can anyone recommend a way to do this?
You should normally store variables that are needed application-wide in application scope in the onApplicationStart method. For example,
<cfset application.adminUsername = "BKBK">
<cfset application.adminPassword = "kB43kB21">
<cfset application.datasource = "myDSN">
This occurs once only. You may then use application.adminUsername, application.adminPassword, etc., anywhere in the application.