Solved

CFMAIL PDF documnet as email attachments

Posted on 2007-12-06
5
1,258 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Why You Need a DevOps Toolchain

IT needs to deliver services with more agility and velocity. IT must roll out application features and innovations faster to keep up with customer demands, which is where a DevOps toolchain steps in. View the infographic to see why you need a DevOps toolchain.

Question has a verified solution.

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

Suggested Solutions

The technique is by far very Simple! How we can export the ColdFusion query results to DOC file?  Well before writing this I researched a lot in Internet but did not found a good Answer anyways!  So i thought now i should share my small snippet w…
CFGRID Custom Functionality Series -  Part 1 Hi Guys, I was once asked how it is possible to to add a hyperlink in the cfgrid and open the window to show the data. Now this is quite simple, I have to use the EXT JS library for this and I achiev…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

751 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