troubleshooting Question

CFMAIL Sending Intermittent Blank Emails

Avatar of squickel
squickel asked on
ColdFusion Language
6 Comments1 Solution667 ViewsLast Modified:
As part of our application we have a page that sends emails messages to multiple recipients individually. In about 10% - 15% of cases the emails go out to the recipient with a blank message body and no attachment (had there been one specified). As part of this routine we allow the user to specify the number of seconds to delay in between email messages being sent.

Has anyone ever encountered this blank email problem and how did you fix it?
<CFOUTPUT query="GetInvestors">
<CFMAIL to="#GetInvestors.EMail#"
        from="#FromMail#"
        subject="#FORM.subject#"
        server="mail.xxxxxxxxx.com">
  <CFMAILPART type="text" wraptext="74">
     #FORM.Message#
  </CFMAILPART>
  <CFSILENT>
  <CFIF FORM.Attachment_1 neq "">
    <cfmailparam file="#Attachment_Local_File_1#">
  </CFIF>
  <CFIF FORM.Attachment_2 neq "">
    <cfmailparam file="#Attachment_Local_File_2#">
  </CFIF>
  <CFIF FORM.Attachment_3 neq "">
    <cfmailparam file="#Attachment_Local_File_3#">
  </CFIF>
  </CFSILENT>
</CFMAIL>
 
 <!--- Delay Interval Between EMail Transmissions --->
 <CFIF IsDefined("FORM.Delay") AND FORM.Delay GT 0>
   <CFSET MailCounter = MailCounter + 1>
  <SCRIPT>
    UpdTable('#NumberFormat(MailCounter,"9,9")# of #NumberFormat (GetInvestors.RecordCount,"9,9")#',"#GetInvestors.EMail#",'#DateFormat(Now(),"mmm d, yyyy")# at #TimeFormat(Now(),"h:mm:ss tt")#')
  </SCRIPT>
 
  <CFSET StartTime = Now()>
  <CFLOOP condition="TRUE">
    <CFIF DateDiff("s",StartTime,Now()) GTE #FORM.Delay#>
      <CFBREAK>
    </CFIF>	
   </CFLOOP>
   <CFFLUSH>
</CFIF>
</CFOUTPUT>
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 6 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros