2012-06-20 1 views
1

첨부 파일이 포함 된 전자 메일을 보내려하지만 익숙하지 않은 오류가 발생합니다.CFMail을 사용하여 첨부 파일이있는 메일을 보내려고하는 중 오류가 발생했습니다.

이것은 <cfmail> 태그 내 코드입니다 :

<CFMAIL FROM="[email protected]" TO="[email protected]" 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> 

내가 첨부하려고 파일이 존재 않음을 유의하시기 바랍니다.

+2

cfmailparam에 파일 이름 (2011093475839213.txt)을 보냅니다. "C : \ WebServerPath \ Files \ 2011093475839213.txt"전체 경로를 지정하지 않아도됩니다. – JMC

+0

오류가 발생하여 올바른 것으로 나타납니다. 해결책입니다 :'CurrentDirectory # \ CurrentDirectory # \ # result.NAME # "처분 ="첨부 파일 "type ="text ">' – Geo

+0

JMC가 솔루션을 제공하면 답변으로 게시해야합니다. 그것을 받아 들일 수있다 – Leigh

답변

1

파일의 경로를 지정하는 올바른 방법입니다.

<cfmailparam file="#CurrentDirectory#\#result.NAME#" disposition="attachment" type="text"> 
+0

미래의 독자를위한 푯말 역할을하도록 답변을 "수락"하는 것을 잊지 마십시오. – ale

+0

나는 내일까지 내 자신의 대답을 받아 들여야한다. 나는 그것을 내일 첫 번째로 받아 들일 것을 확실히 할 것입니다. 감사 – Geo