【发布时间】:2014-01-30 19:09:53
【问题描述】:
我正在尝试发送一封带有附件的电子邮件,但我收到了一个我不熟悉的错误。
这是我的<cfmail> 标签代码:
<CFMAIL FROM="test@test.com" TO="test2@test2.com" SUBJECT="Test" type="HTML">
<P> This is the attachments test</P>
<p> For this test to be successful, we need to receive some file attachments with this email</p>
<cfsilent>
<cfloop query="result">
<cfmailparam file="#result.NAME#" disposition="attachment">
</cfloop>
</cfsilent>
</cfmail>
这是错误:
The resource 2011093475839213.txt was not found.
**The root cause was: ''.**
The error occurred in E:\sites\Example.Com\FolderExistsTest.cfm: line 71
69 : <cfloop query="result">
70 :
71 : <cfmailparam file="#result.NAME#" disposition="attachment" type="text">
72 :
73 : </cfloop>
请注意,我要附加的文件确实存在。
【问题讨论】:
-
您正在向 cfmailparam 发送文件名 (2011093475839213.txt)。您不必指定完整路径“C:\WebServerPath\Files\2011093475839213.txt”
-
我发现了错误,你是对的。这是解决方案:
<cfmailparam file="#CurrentDirectory#\#result.NAME#" disposition="attachment" type="text"> -
如果江铃提供了解决方案,他应该将其作为答案发布,以便您接受它
-
我在 JMC 在这里发布他的建议之前找到了解决方案,但我很乐意将他的正确答案归功于他,因为他是正确的。
标签: coldfusion coldfusion-9 cfmail