As a matter of reuse I would replace all the global and
scoped variables in your functions with arguments or create them
internally. E.g.:
<cfargument name="Mode" required="yes" type="string">
<cfargument name="EmailAddress" required="yes"
type="string">
<cfargument name="LogFileInfo" required="yes"
type="string">
<cfset var CreateLogDate = DateFormat(Now(),
"mm/dd/yyyy">
<cfset var CreateLogTime= TimeFormat(Now(), "hh:mm:ss
tt">
When you have global variables, form varaibles and other
scoped variables in your function you are not encapsulating your
function, you are making it dependent on the existance of these
variables. This is turn will cause headaches with reusing this
function as well cause potential bugs.
In any regard you may want to look into the tag <cflog>
which does alot of writing the log for you.