Skip to main content
November 8, 2006
Question

EMAIL WITH REPORT NOT WORKING

  • November 8, 2006
  • 4 replies
  • 397 views
I have the Display version of this report working on line. Now, I am trying to email the report to the individual requesting the report. It is getting an error message on the second <table> saying it contains invalid data. I am working with a client on Coldfusion 5, so we are NOT using current software.

Can a report even be emailed?

If yes, how do I approach this. I could not find any previously written problems on this, so it may not even be possible. The report is much larger that below, but below includes the error and did not see any reason to attach the entire report.

Thanks for any guidance.

<CFMAIL TO="#Session.SecurityEmailAddress#"
FROM="System@jasco.org"
SUBJECT="Request Chronology Report"
SERVER="10.130.1.76"
PORT="25"
TIMEOUT="30">

<table>
<tr>
<td width="50">
 
</td>
<td>
<img src="images/TITLE-AgencyReporting-400-40.gif" width=500 height=45>
</td>
</tr>
</table>

<table width="600", bgcolor="#ffffff", cellpadding="0", cellspacing="0", border="3">
<tr>
<td rowspan="3">
<center><img src="images/911logo-1000-1000.gif" width=120 height=120></center>
</td>
<td colspan="3" height="30">
<cfoutput><center><h2>#Session.InquiryAgencyName#</h2></center></cfoutput>
</td>
</tr>
<tr>
<td colspan="3" height="30">
<center><img src="images/title-ChronologyReport-400-40.gif" width=400 height=35></center>
</td>
</tr>
<tr>
<td width="*" height="60">
<cfoutput><center><h2>Event Number: #Session.ChronologyNumber#</h2></center></cfoutput>
</td>
</tr>
</table>

<cfoutput query="GetChronologyList">

<cfset ExtractHdrYear = "#Left(getchronologylist.cdts, 4)#">
<cfset ExtractHdrMonth = "#Mid(getchronologyList.cdts, 5, 2)#">
<cfset ExtractHdrDay = "#Mid(getchronologyList.cdts, 7, 2)#">
<cfset HdrPrintDate = "#ExtractHdrMonth#/#ExtractHdrDay#/#ExtractHdrYear#">
</cfoutput>
</CFMAIL>
This topic has been closed for replies.

4 replies

Participating Frequently
November 9, 2006
Thats what I did for out mail reports its not super pretty but.
The action on the form point to a page containing below code .
THis page has the CFMAIl and the SQL INSERT on it.

<cfmail to="Admin@PreventPollution.org"
from="Events@PreventPollution.org"
subject="New Event Added, #FORM.EventName#"
server="pop3.preventpollution.org"
cc="#MailTo#"
>

Event Name: #FORM.EventName#
StartDate: #FORM.StartDate#
End Date: #FORM.EndDate#

Description:
#FORM.EventDescription#
</cfmail>
<cflocation url="mailer.cfm">
</cfif>

Hope that Helps...
Tom
Participating Frequently
November 8, 2006
I'm not sure if <cfsavecontent> was in CF5 or not, but you could create a string that contains all the output from your <cfoutput query=""> loop, then simply output that string in your <cfmail> tag.
November 8, 2006
Thanks, that got me one giant step closer, but now it does not like the
<cfoutput query="GetChronologyList"> stating <cfoutput> within CFMAIL
is not valid. This query is reading one to many records, so I cannot simply put the query inline because that will only read the first occurance of a record.

Is there some other technique to read multiple records for a report within
<CFMAIL> ?

Thanks
Ron
Participating Frequently
November 8, 2006
it's your bgcolor line in that table.

Do a double-hash, like this:
bgcolor="##ffffff"