• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Send attachments with cfmail???

Guest
Nov 06, 2006 Nov 06, 2006

Copy link to clipboard

Copied

Greetings!
I'm in a pickle...I need to send out information to our list. It's long. I'd rather send a letter with CFMAIL and send the rest as a PDF attachment, but I don't know the coding and settings for attachments! :D

Help?
Many thanks!!!
TOPICS
Advanced techniques

Views

2.5K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Nov 06, 2006 Nov 06, 2006
Check out the documentation for <cfmailparam ...> it gives a couple of
examples.


<h3>cfmailparam Examples</h3>
<p>This view-only example uses cfmailparam to 1) add header to a message
and 2) attach files and 3) to return a receipt to the sender.</p>

<cfmail from = "peter@domain.com" To = "paul@domain.com" Subject = "See
Important Attachments and Reply">
<cfmailparam name = "Importance" value = "High">
Please review the new logo. Tell us what you think.
<cfmailparam file = "c:\work\readm...

Votes

Translate

Translate
LEGEND ,
Nov 06, 2006 Nov 06, 2006

Copy link to clipboard

Copied

Check out the documentation for <cfmailparam ...> it gives a couple of
examples.


<h3>cfmailparam Examples</h3>
<p>This view-only example uses cfmailparam to 1) add header to a message
and 2) attach files and 3) to return a receipt to the sender.</p>

<cfmail from = "peter@domain.com" To = "paul@domain.com" Subject = "See
Important Attachments and Reply">
<cfmailparam name = "Importance" value = "High">
Please review the new logo. Tell us what you think.
<cfmailparam file = "c:\work\readme.txt" type="text/plain">
<cfmailparam file = "c:\work\logo.gif" type="image/gif">
<cfmailparam name="Disposition-Notification-To" value="peter@domain.com">
</cfmail>

<p>This view-only example displays an image in the body of
an HTML message.</p>

<cfmail type="HTML"
to = "#form.mailto#"
from = "#form.mailFrom#"
subject = "Sample inline image">
<cfmailparam file="C:\Inetpub\wwwroot\web.gif"
disposition="inline"
contentID="image1">
<P>There should be an image here</p>
<img src="cid:image1">
<p> After the picture</p>
</cfmail>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Nov 06, 2006 Nov 06, 2006

Copy link to clipboard

Copied

Greetings and thanks - I think maybe I should clarify what I'm doing. I think your reply was close to what I need, but I'm a bit confused - sorry!

I am sending a newsletter-type HTML email to our subscriber list (ourquery), and would like to ADD an attachment to that for viewing, specifically, a PDF for best viewability/printing. Here's the code we usually use to send out the newsletter:

<CFMAIL
TO="#ourquery.Email#"
FROM="our reply email"
TYPE="HTML"
QUERY="ourquery"
SERVER="scriptmail.our isp.net"
SUBJECT="our subject line here">
(HTML content goes here)
</CFMAIL>

So, within this scenario, where would I add the attachment (path?) and would it be the CFMAILPARAM code as you reccomend or a MIMEATTACH= CODE, or ???

MANY THANKS!!!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 06, 2006 Nov 06, 2006

Copy link to clipboard

Copied

I am sending a newsletter-type HTML email to our subscriber list
(ourquery), and would like to ADD an attachment to that for viewing,
specifically, a PDF for best viewability/printing. Here's the code we
usually use to send out the newsletter:


That is what was shown in the first example, note the <cfmail ...>
wrapping the mail message and the two attached files, readme.txt and
logo.gif. This example also shows adding a couple of headers to the
mail message.

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

<cfmailparam name = "Importance" value = "High">

Please review the new logo. Tell us what you think.

<!--- An Attached File ---><cfmailparam file = "c:\work\readme.txt"
type="text/plain">
<!--- An Attached File ---><cfmailparam file = "c:\work\logo.gif"
type="image/gif">

<cfmailparam name="Disposition-Notification-To"
value="peter@domain.com">
</cfmail>



Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Nov 06, 2006 Nov 06, 2006

Copy link to clipboard

Copied

LATEST
Many thanks again for your assistance!

I designated your original reply as the answer, as that is what worked for me. Thank you also for your patience with me and assisting me in working this out. I consulted with my ISP for the correct path to the file and the code worked great!

Once again, many thanks!

JL

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Nov 06, 2006 Nov 06, 2006

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Nov 06, 2006 Nov 06, 2006

Copy link to clipboard

Copied

Mny thanks...but I get an error message:

Security: The requested template has been denied access to (filename).pdf.
The following is the internal exception message: access denied (java.io.FilePermission CONF06REGISTRATIONFORM.pdf read)

with (filename) my change in the code for this posting.

Is there something I'm missing?
This is not a form/download of an attachment, but a newsletter we would send out to a list via a query of that list with an attachment.

many thanks...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 06, 2006 Nov 06, 2006

Copy link to clipboard

Copied

The ColdFusion service user (default localSystem) must have permission
to do anything with the file system or other resource. If the
attachment was a local file on the server I would expect it to under the
default permissions of the default localSystem user. But if any of the
assumptions are incorrect it could cause a problem.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Nov 06, 2006 Nov 06, 2006

Copy link to clipboard

Copied

"The ColdFusion service user (default localSystem) must have permission
to do anything with the file system or other resource. If the
attachment was a local file on the server I would expect it to under the
default permissions of the default localSystem user. But if any of the
assumptions are incorrect it could cause a problem."

Q: when you say 'local file' and 'localsystem' user, are you referring to the server local to the file being run (e.g. our ISP server)? I'm just wondering if/how I might need to adjust the c:\ ...path to 'retrieve' the file I am trying to attach.

Many, many thanks!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation