Solved

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

Posted on 2004-10-18
10
230 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
Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

 
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
 

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
What are the real risks of enabling 3rd party Google drive apps 28 140
javascript to html map 8 93
site launch date and last modified date 3 98
http to https 3 69
This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

809 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