Solved

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

Posted on 2004-10-18
10
237 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

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

Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
The purpose of this video is to demonstrate how to properly insert a Vimeo Video into a WordPress site or Blog. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp…
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…

623 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