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

Attaching generated excel file in cfmail

Participant ,
Nov 04, 2008 Nov 04, 2008

Copy link to clipboard

Copied

Hi,

I've attached the code in which I've generated an excel file from my data, which the user can then open/save on their PC. I now want to attach this excel file to an email (using cfmail) and send it (the task will then become scheduled).

How do I save rather than output the excel file?

Katie
TOPICS
Advanced techniques

Views

1.6K

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

Participant , Nov 04, 2008 Nov 04, 2008
Hi,

Have a look at the following tags:

1)
<cfsavecontent> to generate a variable from your tab-delimited content
<cffile action = "write"> to generate a temp file with your content
<cfmail> and attach that file to your email
or
2)
<cfsavecontent>
<cfmail>,<cfmailpart> to attach the variable directly to the email without creating a temp file first (have not tried that myself)

cheers,
fober

Votes

Translate

Translate
LEGEND ,
Nov 04, 2008 Nov 04, 2008

Copy link to clipboard

Copied

Using cfcontent does not create an excel file on your server. It gives the user the opportunity to save a .xls file on their local machine, or to view the contents in a version of excel that opens in a browswer. This means it's not available to email using cold fusion.

I know you can create excel files on your server with cf, but I don't know how.

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
Participant ,
Nov 04, 2008 Nov 04, 2008

Copy link to clipboard

Copied

Hi,

Have a look at the following tags:

1)
<cfsavecontent> to generate a variable from your tab-delimited content
<cffile action = "write"> to generate a temp file with your content
<cfmail> and attach that file to your email
or
2)
<cfsavecontent>
<cfmail>,<cfmailpart> to attach the variable directly to the email without creating a temp file first (have not tried that myself)

cheers,
fober

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
Participant ,
Nov 05, 2008 Nov 05, 2008

Copy link to clipboard

Copied

Thanks you both, I'll let you know how I get on :)

Katie

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
Participant ,
Nov 05, 2008 Nov 05, 2008

Copy link to clipboard

Copied

Thanks you both, I'll let you know how I get on :)

Katie

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
Participant ,
Nov 05, 2008 Nov 05, 2008

Copy link to clipboard

Copied

LATEST
Thanks so much Fober! My final code is below..

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