At 12:19 PM 12/3/2012, you wrote:
>Anyone have any experience, comments using hmailserver with Coldfusion?
I use it.. Works nicely. Here is a short snippet that will create a
new email address via coldfusion. (the domain must already be set up).
<cffunction name="createNewEmail" access="public" returntype="string">
<cfargument name="email" type="string" required="yes">
<cfargument name="ppassword" type="string"
required="yes">
<cfset status="good">
<cfset subdomain = listlast(email,'@')>
<cftry>
<CFOBJECT ACTION="Create"
NAME="hmail"
CLASS="hMailServer.Application">
<cfset temp=hmail.Authenticate("Administrator", "*your Admin Password *")>
<cfset domain=hmail.Domains.ItemByName("#subdomain#")>
<cfset account= domain.Accounts.Add()>
<cfset account.Address='#email#'>
<cfset account.Password='#ppassword#'>
<cfset account.Active=True>
<cfset account= Account.Save()>
<cfcatch type="any">
<cfset status='Bad'>
</cfcatch>
</cftry>
<cfreturn status>
</cffunction>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353355
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm