Solved

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

Posted on 2004-10-18
10
227 Views
Last Modified: 2013-12-24
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
Comment
Question by:javanigus
10 Comments
 
LVL 35

Accepted Solution

by:
mrichmon earned 200 total points
ID: 12340595
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
 
LVL 5

Expert Comment

by:smaglio81
ID: 12340675
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
 
LVL 7

Expert Comment

by:black0ps
ID: 12340702
You might want to try putting the loop in the cfmail tag:

<cfmail query="filteredlist">
0
 
LVL 35

Expert Comment

by:mrichmon
ID: 12341334
No do NOT put the loop inside the cfmail tag - known problems with cfmail and nested cfloops
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:javanigus
ID: 12341402
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
 
LVL 7

Expert Comment

by:black0ps
ID: 12341546
mrichmon, haven't had a problem using loops in cfmail. What kind of problems exist with this?

-- Ian
0
 
LVL 35

Expert Comment

by:mrichmon
ID: 12341667
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
 
LVL 7

Expert Comment

by:black0ps
ID: 12341694
Was it in 6.1?
0
 
LVL 35

Expert Comment

by:mrichmon
ID: 12342285
It was in MX (6.0)
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Domino Load Balancer For 2048 Key Requirement 7 33
IIS 8.5 2 44
Web Development Tools for MVC 3 63
Problem to go to Web page 2 52
In this short web based tutorial, I wanted to show users how they can still use the powers of FrontPage in conjunction with Expression Web 3.  Even though Microsoft eliminated the use of Web components, we can still use them with FrontPage and edit …
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
The purpose of this video is to demonstrate how to insert an Iframe into WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Open Page or Post…
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now