Solved

CFMAIL PDF documnet as email attachments

Posted on 2007-12-06
5
1,242 Views
Last Modified: 2012-08-13
I am generating a pdf using cfdocument. Once I have create the pdf's I want to able to attach them to the cfmail code. I also want to over write the PDF's when a new on is created.

<cfdocument
overwrite = "yes"
format="pdf"
pagetype="letter"
marginleft=".5"
marginright=".5"
margintop=".5"
marginbottom=".5">
<cfinclude template="cle_cert.cfm">
</cfdocument>
0
Comment
Question by:smares323
5 Comments
 
LVL 18

Expert Comment

by:Plucka
ID: 20424743
Get CFDOCUMENT to write the PDF to a file then you can just use <CFMAIL

and the mimeattach = "path" attribute

with the ouput file. The overwrite attribute will replace it each time.
0
 
LVL 39

Accepted Solution

by:
gdemaria earned 500 total points
ID: 20425582
Here's the syntax..

<cfmail from = "peter@domain.com" To = "paul@domain.com"
            Subject = "See Important Attachments and Reply">

  Please read the attached PDF file and let us know what
  you think.

  <cfmailparam file = "c:\work\mydocument.pdf">
</cfmail>

Be aware that you should not allow the file to be deleted or replaced too quickly.  After running the CFMAIL tag, the email is placed in the spooler and may take 10 or 15 seconds before going out.  The PDF file attachment must exist for that period of time or the email will error and not go out.   Also, if you overwrite the file during that period, you will send out the new PDF file with the old email.

0
 

Author Comment

by:smares323
ID: 20428858
do I have include the mimeattach = "path" attribute whith in cfmail tag.
0
 
LVL 39

Expert Comment

by:gdemaria
ID: 20429186
you can use either approach, the mimeattach or the cfmailparam
0
 
LVL 1

Expert Comment

by:chair9design
ID: 23143668
Is it possible to know if the email has been sent/cleared from the CFMAIL spool  and use that as a trigger to know when it's okay to delete the file from the server?

For example...once an email finally sent after waiting in the mail queue it could send a response to a script that would take the file attachment name from the email that was just sent and then delete the file at that time. to keep there from being a build up of pdfs?

Sorry to re-open an old thread, but I was curious if it was possible to have any input/clarification on knowing when it's safe to delete the file.

Thanks a lot!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Hi, Even though I have created this Tutorial on My personal Blog, Some people might not able to find my website, So here i am posting it again Today, from the topic it is very clear that i will be showing you here the very basic usage of how we …
I spent nearly three days trying to figure out how incorporate OAuth in Coldfusion for the Eventful API. Hopefully, this article will allow Coldfusion Programmers to buzz through the API when they need to. Basically, what this script does is authori…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

840 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