Advertisement
Guest User

Untitled

a guest
Oct 6th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. <cfmail to="me@mydomain.com" from="you@yourdomain.com" subject="Subject" type="html">
  2. <cfmailparam file="http://myfilelocation/pdfFile.pdf">
  3. Body of the email
  4. </cfmail>
  5.  
  6. <cfmail to="me@mydomain.com" from="you@yourdomain.com" subject="Subject" type="html">
  7. <cfmailparam file="d:websitesmysiteresourcespdf1.pdf">
  8. Body of the email
  9. </cfmail>
  10.  
  11. <cfset tempFile = getTempDirectory(getTempFile()) />
  12. <cfhttp url="http://myfilelocation/pdfFile.pdf" method="get" file="#tempFile#"></cfhttp>
  13.  
  14. <cfmail to="me@mydomain.com" from="you@yourdomain.com" subject="Subject" type="html">
  15.    <cfmailparam file="#tempFile#">
  16.    Body of the email
  17. </cfmail>
  18.  
  19. <cfhttp method="get" url="http://myfilelocation/pdfFile.pdf">
  20. <!---conversion--->
  21. <cfif IsSimpleValue(cfhttp.Filecontent)>
  22. <cfset content = cfhttp.Filecontent>
  23. <cfelse>
  24. <cfset content = cfhttp.Filecontent.toByteArray()>
  25. </cfif>
  26.  
  27. <cfmailparam file="#fileNameOfYourChoice#" type="#cfhttp.Mimetype#" content="#content#" />
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement