Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 239
  • Last Modified:

<CFMAIL in LOOP. Getting error writing mail message to disk. Why?

Hi, I'm mass emailing a bunch of my subscribers a HTML email with a Word document as an attachment but I'm getting a Coldfusion error saying "Unable to write mail message to disk."

The relavant part of the code is:
-------------------------------------------------------
<cfloop query="filteredlist">

<CFMAIL
           from="#form.creator#"
           to="#email#" type="#mailtype#"
           subject="#form.subject#"
           mimeattach="#sourcedir#tools\membershiptools\attachments\#serverFile#">
#form.message#
</CFMAIL>
</cfloop>

Any idea why I'm getting this error?

Thanks,

Abdullah
0
javanigus
Asked:
javanigus
1 Solution
 
mrichmonCommented:
Instead of mimeattach remove that line and try this :

<CFMAIL
           from="#form.creator#"
           to="#email#" type="#mailtype#"
           subject="#form.subject#">

<cfmailparam file="#sourcedir#tools\membershiptools\attachments\#serverFile#">
#form.message#

</CFMAIL>

ALso may want to see if it is related to the cfloop....
0
 
smaglio81Commented:
Nope, I don't know why you are getting that error. I don't really see why CF would be writing the mail message to a disk. But, have you tried more explicit ways of sending the email. For example:


<cfloop query="filteredlist">

<cfmail
           from="#form.creator#"
           to="#filteredlist.email#"
           type="html"
           subject="#form.subject#"
           >
           <cfmailparam file="#sourcedir#tools\membershiptools\attachments\#serverFile#" />
#form.message#
</cfmailL>

</cfloop>

I changed the 'type' attribute to the constant "html"; I don't know if that will help anything. But the use of cfmailparam might reset something in the MIME attachement system of the cfmail processing; I stress the 'might' part.

I guess you already checked the application logs to find the error message; but maybe macromedia might have a support article on that particular error message. When I searched there was a couple of strange pages that popped up, like:

http://www.macromedia.com/support/coldfusion/ts/documents/tn17815.htm, which is a Coldfusion 4.5.1 SP2 update page that listed your error as bug #18459. This bug number lead me to a custom tag in the developers section (http://www.macromedia.com/cfusion/exchange/index.cfm?view=sn131&extID=1001777). The custom tag's description claims to be able to fix the error. But, you never know till you try it, right?

HTH

Steven
0
 
black0psCommented:
You might want to try putting the loop in the cfmail tag:

<cfmail query="filteredlist">
0
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
mrichmonCommented:
No do NOT put the loop inside the cfmail tag - known problems with cfmail and nested cfloops
0
 
javanigusAuthor Commented:
Thanks for all your comments but I found out that there is a CFMAIL attribute called "spoolenable" which takes Yes or No and defaults to Yes if not specified / included in the CFMAIL tag. If spoolenable = Yes, CF saves the messages to disk first before sending them out to recipients. If spoolenable = No, CF saves the messages to memory. I didn't have spoolenable included so CF took it as a Yes and therefore was writing my 8000 messages to disk first before sending them out to recipients. I guess somewhere along the line there was a glitch and CF couldn't save a message to disk for some reason and that caused the error.

That's it.

Thanks again though.

Abdullah
0
 
black0psCommented:
mrichmon, haven't had a problem using loops in cfmail. What kind of problems exist with this?

-- Ian
0
 
mrichmonCommented:
Well, I can't seem to find my link to the post on the Macromedia exchange where I was talking with a Macromedia developer - it is possible then that it has been fixed....  They have fixed a few of the bugs I have worked with the Macromedia developers on...
0
 
black0psCommented:
Was it in 6.1?
0
 
mrichmonCommented:
It was in MX (6.0)
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now