<cffunction access="public" name="sendMail" rturntype="string" output="true">
<cfargument name="structform" default="" type="struct" required="true">
<cfset var strResult = "">
<cftry>
<cfmail to="#arguments.structform.mailto#" cc="#arguments.structform.mailcc#" from="abc@abc.com" subject="#arguments.structform.subject#"
type="html" priority="1">
<cfif isDefined('arguments.structform.body') AND arguments.structform.body EQ 1>
#trim(paragraphFormat(arguments.structform.contents))#
<cfelse>
<table width="80%" align="center" cellspacing="1" cellpadding="2">
<tr><td>
<p>
<table align="center" width="90%">
<tr><td>
<h2>
<cfif isDefined('arguments.structform.Option') AND arguments.structform.Option EQ 1>Testing</cfif>: <br>
Date: #DateFormat(now(),'mm/dd/yyyy')#
</h2>
</td></tr>
<tr>
<td>
Your Details Go here
<br>
</td>
</tr>
</table>
</p></td></tr>
</table>
</cfif>
</cfmail>
<cfset strResult = "Email Send Successfully">
<cfcatch>
<cfset str = "Error! #cfcatch.detail# #cfcatch.message#">
<cflog file="error.log" text="#cfcatch#">
</cfcatch>
</cftry>
<cfreturn strResult>
</cffunction>
Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.
Comments (0)