home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / CHIPCD_02_2002.iso / Internet / Macromedia ColdFusion Server 5 / coldfusion-50-win-us.exe / data1.cab / Examples / CFDOCS / exampleapps / email / viewmsg.cfm < prev    next >
Encoding:
Text File  |  2001-06-13  |  3.5 KB  |  101 lines

  1. <CFINCLUDE TEMPLATE="_header.cfm">
  2.  
  3. <!--- Separator is based on OS --->
  4. <CFLOCK SCOPE="Server" TIMEOUT="30" TYPE="ReadOnly">
  5.     <CFIF Server.OS.Name CONTAINS "Windows">
  6.         <CFSET Sep = "\">
  7.     <CFELSE>
  8.         <CFSET Sep = "/">    
  9.     </CFIF>
  10. </CFLOCK>
  11.  
  12. <!--- Create main temp directory if it doesn't already exist --->
  13. <CFSET TempDir = GetTempDirectory() & "CrazyCab#Sep#">
  14. <CFTRY>
  15.     <CFDIRECTORY ACTION="CREATE" DIRECTORY="#TempDir#">
  16.     <CFCATCH TYPE="ANY">
  17.     </CFCATCH>
  18. </CFTRY>
  19.  
  20. <!--- Create inbound temp directory if it doesn't already exist --->
  21. <CFSET AttachDir = TempDir & "inbound#Sep#">
  22. <CFTRY>
  23.     <CFDIRECTORY ACTION="CREATE" DIRECTORY="#AttachDir#">
  24.     <CFCATCH TYPE="ANY">
  25.     </CFCATCH>
  26. </CFTRY>
  27.  
  28. <CFPOP ACTION="GETALL"
  29.        NAME="Message"
  30.        MESSAGENUMBER="#URL.Msg#"
  31.        SERVER="#Session.POPserver#"
  32.        USERNAME="#Session.Username#"
  33.        PASSWORD="#Session.Password#"
  34.        ATTACHMENTPATH="#AttachDir#">
  35.  
  36. <CFSET Body = Message.Body>
  37. <CF_Wrap VARIABLE="Body" WIDTH=50>
  38.  
  39. <table border="0" cellspacing="0" cellpadding="0">
  40. <CFOUTPUT>
  41. <tr>
  42.     <td bgcolor="cc9900" valign="top" rowspan=2 width="55"><FONT FACE="Helvetica" SIZE="-1" color="FFffcc"><B><a href="messagelist.cfm"><img src="images/back.gif" width=46 height=36 border=0 alt=""></a></td>
  43.     <td bgcolor="cc9900" height=5 colspan=3><img src="images/curve3.gif" width=1 height=1 border=0 alt=""></td>
  44.     <td valign="top" rowspan=2><img src="images/curve3.gif" width=36 height=36 border=0 alt=""></td>
  45. </tr>
  46. <TR>
  47.     <TD valign=top bgcolor="cc9900"><FONT FACE="Helvetica" SIZE="-1" color="FFffcc"><B><a href="compose.cfm"><img src="images/compose.gif" width=29 height=25 border=0 alt="" align="left">Compose</a>  </TD>
  48.     <TD valign=top bgcolor="cc9900"><FONT FACE="Helvetica" SIZE="-1" color="FFffcc"><B><a href="reply.cfm?Msg=#URL.Msg#"><img src="images/reply.gif" width=36 height=26 border=0 alt="" align="left">Reply</a>  </TD>
  49.     <TD valign=top bgcolor="cc9900"><FONT FACE="Helvetica" SIZE="-1" color="FFffcc"><B><a href="forward.cfm?Msg=#URL.Msg#"><img src="images/forward.gif" width=35 height=25 border=0 alt="" align="left">Forward</a></TD>
  50. </TR>
  51. </CFOUTPUT>
  52. </TABLE>
  53. <table border="0" cellspacing="2" cellpadding="25" align="CENTER" bgcolor="#660000">
  54. <TR>
  55.     <TD width=400 nowrap bgcolor="FFffcc">
  56.  
  57.     <FONT COLOR="#000000">
  58.  
  59.     <CFIF IsDefined("URL.FullHeaders")>
  60.  
  61.         <CFOUTPUT>#HTMLCodeFormat(Message.Header)#</CFOUTPUT>
  62.  
  63.     <CFELSE>
  64.  
  65.         <CFOUTPUT QUERY="Message">
  66.  
  67.         <FONT FACE="Helvetica" SIZE="-1" COLOR="##000000">
  68.         <P><B>Date:</B> #Date#<BR>
  69.         <B>From:</B> #HTMLEditFormat(From)#<BR>
  70.         <B>To:</B> #HTMLEditFormat(To)#<BR>
  71.         <B>cc:</B> #HTMLEditFormat(cc)#<BR>
  72.         <B>Subject:</B> #HTMLEditFormat(Subject)#<BR>
  73.         <FONT SIZE="1"><A HREF="viewmsg.cfm?Msg=#URL.Msg#&FullHeaders=On">Click here for full headers</A></FONT></P>
  74.         </FONT>
  75.  
  76.         </CFOUTPUT>
  77.  
  78.     </CFIF>
  79.  
  80.     <CFOUTPUT>
  81.     <PRE>--------</PRE>
  82.     #HTMLCodeFormat(Body)#
  83.     </CFOUTPUT>
  84.     <CFIF Message.Attachments NEQ "">
  85.     <FONT FACE="Helvetica" SIZE="-1"><B>Attached:</B>
  86.     <CFLOOP FROM="1" TO="#ListLen(Message.Attachments,'    ')#" INDEX="CurrItem">
  87.         <CFSET FileName = "#AttachDir##URLEncodedFormat(GetFileFromPath(ListGetAt(Message.AttachmentFiles, CurrItem, '    ')))#">
  88.         <CFSET FileName = Replace(FileName, "%2E", ".", "ALL")>
  89.         <CFOUTPUT>
  90.             <A HREF="getfile.cfm/#GetFileFromPath(Filename)#?Filename=#URLEncodedFormat(Filename)#">#ListGetAt(Message.Attachments, CurrItem, "    ")#</A>
  91.         </CFOUTPUT>
  92.     </CFLOOP>
  93.     </FONT>
  94.     </CFIF>
  95.     </FONT>
  96.  
  97.     </TD>
  98. </TR>
  99. </TABLE>
  100.  
  101. <CFINCLUDE TEMPLATE="_footer.cfm">