나는 사용자 정의 PDF를 생성하고 메일을 보낸 다음 삭제하는 응용 프로그램을 만들고 있습니다. 3 가지 구성 요소를 모두 별도로 테스트했지만 작동하지만 이메일을 함께 보내면 보내지 않습니다.CFmail이 보내는 데 얼마나 걸립니까?
삭제가 스크립트의 뒤에있는 경우에도 전자 메일이 전송되기 전에 첨부 파일이 삭제 될 수 있습니까?
여기 내 코드입니다.
<!---Get the PDF--->
<cfscript>
PDFBuilder = createobject("component", "form_admin.email.PDFBuilder");
pdf = PDFBuilder.createPDF(form_id);
</cfscript>
<!---Create link to the pdf --->
<cfscript>
foo = expandPath('../email/tmp/') & pdf & '.pdf';
</cfscript>
<!---Create email--->
<cfmail to="[email protected]"
from="[email protected]"
subject="Jag intrest form. "
type="text/html" >
<cfmailparam file="#foo#">
Dear #getEmail.title#, #getEmail.first_name# #getEmail.surname# <br />
Attached is a PDF boucher telling you more information about the cars you were interested in. <br />
Best wishes <br />
Jaguar <br /><br /><br /><br /><br /><br /><br /><br />
This is not actually jaguar this is a test application by Hazardousfrog.
</cfmail>
<!---Delete the file after it has been sent --->
<cfif FileExists(#foo#)>
<cffile action="delete"
file="#foo#">
<cfelse>
<cfoutput >
error
</cfoutput>
<cfabort>
</cfif>
죄송합니다. 코드가 좋지 않은 경우 2 주 동안 CF 만 수행했습니다.
스풀에 가기 전에 첨부 파일을 찾을 수 없을 때 오류가 발생했습니다. "세부 정보 : 루트 원인 : ''메시지 : 리소스 d : \ 내 웹 루트 폴더 \ 첨부 할 파일 .pdf 파일을 찾을 수 없습니다. " CF 관리자의 메일 로그에 액세스 할 수 있으면 메일 서버 로그에 유용한 것이 있는지 확인할 수 있습니다. – Travis
그는 생각보다 며칠 동안 자신의 대답을 받아 들일 수 없습니다. – Travis
@Travis : 나는 알고있다. 그러나 나는 그의 대답에 대하여 이틀 동안 기억할 것인지는 확신하지 못한다. :) –