Note that there are some explanatory texts on larger screens.

plurals
  1. POHow long does CFmail take to send?
    primarykey
    data
    text
    <p>I am making an app that creates a custom PDF, mails it and then deletes it. I have tested all 3 components separately and they work but when I put them together the email doesn't send. </p> <p>Is it possible that the attachment gets deleted before the email is sent even though the delete is after it in the script?</p> <p>Here is my code. </p> <pre><code>&lt;!---Get the PDF---&gt; &lt;cfscript&gt; PDFBuilder = createobject("component", "form_admin.email.PDFBuilder" ); pdf = PDFBuilder.createPDF(form_id); &lt;/cfscript&gt; &lt;!---Create link to the pdf ---&gt; &lt;cfscript&gt; foo = expandPath('../email/tmp/') &amp; pdf &amp; '.pdf'; &lt;/cfscript&gt; &lt;!---Create email---&gt; &lt;cfmail to="will@hazardousfrog.com" from="will@hazardoufrog.com" subject="Jag intrest form. " type="text/html" &gt; &lt;cfmailparam file="#foo#"&gt; Dear #getEmail.title#, #getEmail.first_name# #getEmail.surname# &lt;br /&gt; Attached is a PDF boucher telling you more information about the cars you were interested in. &lt;br /&gt; Best wishes &lt;br /&gt; Jaguar &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; This is not actually jaguar this is a test application by Hazardousfrog. &lt;/cfmail&gt; &lt;!---Delete the file after it has been sent ---&gt; &lt;cfif FileExists(#foo#)&gt; &lt;cffile action="delete" file="#foo#"&gt; &lt;cfelse&gt; &lt;cfoutput &gt; error &lt;/cfoutput&gt; &lt;cfabort&gt; &lt;/cfif&gt; </code></pre> <p>Sorry if the code isn't great I have only been doing CF for like 2 weeks. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload