Solved

CFMAIL PDF documnet as email attachments

Posted on 2007-12-06
5
1,201 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

706 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now