Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

CFMAIL PDF documnet as email attachments

Posted on 2007-12-06
5
Medium Priority
?
1,350 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 1500 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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

Hi, I will be creating today a basic tutorial on how we can create a Mail Custom Function and use it where ever we want. The main advantage about creating a custom function is that we can accommodate a range of arguments to pass to the Function and …
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…
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 anti-spam), the admin…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

824 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