Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Embeding ODS HTML in E-mail

Status
Not open for further replies.

shenniko

Programmer
Apr 15, 2005
52
US
When sending an E-mail through SAS, is there a way to Embed an ODS HTML report in that E-mail instead of sending it as an attachment??

Thanks in advance

Robbie
 
I've managed to find a sample of code that "should" let me send HTML E-mails through SAS :-

Code:
filename outbox 
email to='robert.gaunt@ntl.com'
type='html/text'
subject='Temperature conversions';
	data temperatures;
	    do centigrade = -40 to 100 by 10;
	      fahrenheit = centigrade*9/5+32;
	      output;
	    end;
	run;

ods html
body=outbox /* Mail it! */        
rs=none; /* <<< THATs it*/
title 'Centigrade to Fahrenheit conversion table';
proc print;
  id  centigrade;
  var fahrenheit;
run;
ods html close;

But when i recieve the e-mail all i get through is the HTML code on a plain text e-mail (Not a html email)..

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">


<HTML>
<!-- Generated by SAS Software -->
<!-- [URL unfurl="true"]Http://www.sas.com[/URL] -->
<HEAD>
<TITLE>SAS Output</TITLE>
<META http-equiv="Content-type" content="text/html;  charset=windows-1252">
</HEAD>
<BODY onload="startup()" onunload="shutdown()" vlink="#004488" link="#0066AA" leftmargin=8 rightmargin=8 bgcolor="#E0E0E0">
<SCRIPT LANGUAGE="JavaScript">
<!-- 
// This script is to load all object onLoad() functions 
function startup(){ }
function shutdown(){ }
//-->
</SCRIPT>

<font  face="Arial, Helvetica, Helv" size="3" color="#002288"><A NAME="IDX">&nbsp;</A>
<CENTER>
<font  face="Arial, Helvetica, Helv" size="3" color="#002288"> 
<TABLE  cellspacing=1 cellpadding=1 rules=NONE frame=VOID border=0 width=100% bgcolor="#E0E0E0">
<TR>
 <TD ALIGN=CENTER bgcolor="#E0E0E0"><font  face="Arial, Helvetica, Helv" size="5" color="#002288"><b><i>Centigrade to Fahrenheit conversion table</i></b></font></TD>
</TR>
</TABLE>
</font></CENTER>
<P>
<CENTER>
<font  face="Arial, Helvetica, Helv" size="3" color="#002288"> 
<TABLE  cellspacing=1 cellpadding=7 rules=GROUPS frame=BOX border=1 bgcolor="#F0F0F0" bordercolor="#000000">
<thead>
<TR>
 <TD ALIGN=CENTER bgcolor="#B0B0B0"><font  face="Arial, Helvetica, Helv" size="4" color="#0033AA"><b>centigrade</b></font></TD>
 <TD ALIGN=CENTER bgcolor="#B0B0B0"><font  face="Arial, Helvetica, Helv" size="4" color="#0033AA"><b>fahrenheit</b></font></TD>
</TR>
</thead>
<tbody>
<TR>
 <TD ALIGN=RIGHT bgcolor="#B0B0B0" nowrap><font  face="Arial, Helvetica, Helv" size="4" color="#0033AA"><b> -40</b></font></TD>
 <TD ALIGN=RIGHT bgcolor="#D3D3D3" nowrap><font  face="Arial, Helvetica, Helv" size="3" color="#000000"> -40</font></TD>
</TR>
<TR>
 <TD ALIGN=RIGHT bgcolor="#B0B0B0" nowrap><font  face="Arial, Helvetica, Helv" size="4" color="#0033AA"><b> -30</b></font></TD>
 <TD ALIGN=RIGHT bgcolor="#D3D3D3" nowrap><font  face="Arial, Helvetica, Helv" size="3" color="#000000"> -22</font></TD>
</TR>
<TR>
 <TD ALIGN=RIGHT bgcolor="#B0B0B0" nowrap><font  face="Arial, Helvetica, Helv" size="4" color="#0033AA"><b> -20</b></font></TD>
 <TD ALIGN=RIGHT bgcolor="#D3D3D3" nowrap><font  face="Arial, Helvetica, Helv" size="3" color="#000000">  -4</font></TD>
</TR>
<TR>
 <TD ALIGN=RIGHT bgcolor="#B0B0B0" nowrap><font  face="Arial, Helvetica, Helv" size="4" color="#0033AA"><b> -10</b></font></TD>
 <TD ALIGN=RIGHT bgcolor="#D3D3D3"><font  face="Arial, Helvetica, Helv" size="3" color="#000000">  14</font></TD>
</TR>
<TR>
 <TD ALIGN=RIGHT bgcolor="#B0B0B0"><font  face="Arial, Helvetica, Helv" size="4" color="#0033AA"><b>   0</b></font></TD>
 <TD ALIGN=RIGHT bgcolor="#D3D3D3"><font  face="Arial, Helvetica, Helv" size="3" color="#000000">  32</font></TD>
</TR>
<TR>
 <TD ALIGN=RIGHT bgcolor="#B0B0B0"><font  face="Arial, Helvetica, Helv" size="4" color="#0033AA"><b>  10</b></font></TD>
 <TD ALIGN=RIGHT bgcolor="#D3D3D3"><font  face="Arial, Helvetica, Helv" size="3" color="#000000">  50</font></TD>
</TR>
<TR>
 <TD ALIGN=RIGHT bgcolor="#B0B0B0"><font  face="Arial, Helvetica, Helv" size="4" color="#0033AA"><b>  20</b></font></TD>
 <TD ALIGN=RIGHT bgcolor="#D3D3D3"><font  face="Arial, Helvetica, Helv" size="3" color="#000000">  68</font></TD>
</TR>
<TR>
 <TD ALIGN=RIGHT bgcolor="#B0B0B0"><font  face="Arial, Helvetica, Helv" size="4" color="#0033AA"><b>  30</b></font></TD>
 <TD ALIGN=RIGHT bgcolor="#D3D3D3"><font  face="Arial, Helvetica, Helv" size="3" color="#000000">  86</font></TD>
</TR>
<TR>
 <TD ALIGN=RIGHT bgcolor="#B0B0B0"><font  face="Arial, Helvetica, Helv" size="4" color="#0033AA"><b>  40</b></font></TD>
 <TD ALIGN=RIGHT bgcolor="#D3D3D3"><font  face="Arial, Helvetica, Helv" size="3" color="#000000"> 104</font></TD>
</TR>
<TR>
 <TD ALIGN=RIGHT bgcolor="#B0B0B0"><font  face="Arial, Helvetica, Helv" size="4" color="#0033AA"><b>  50</b></font></TD>
 <TD ALIGN=RIGHT bgcolor="#D3D3D3"><font  face="Arial, Helvetica, Helv" size="3" color="#000000"> 122</font></TD>
</TR>
<TR>
 <TD ALIGN=RIGHT bgcolor="#B0B0B0"><font  face="Arial, Helvetica, Helv" size="4" color="#0033AA"><b>  60</b></font></TD>
 <TD ALIGN=RIGHT bgcolor="#D3D3D3"><font  face="Arial, Helvetica, Helv" size="3" color="#000000"> 140</font></TD>
</TR>
<TR>
 <TD ALIGN=RIGHT bgcolor="#B0B0B0"><font  face="Arial, Helvetica, Helv" size="4" color="#0033AA"><b>  70</b></font></TD>
 <TD ALIGN=RIGHT bgcolor="#D3D3D3"><font  face="Arial, Helvetica, Helv" size="3" color="#000000"> 158</font></TD>
</TR>
<TR>
 <TD ALIGN=RIGHT bgcolor="#B0B0B0"><font  face="Arial, Helvetica, Helv" size="4" color="#0033AA"><b>  80</b></font></TD>
 <TD ALIGN=RIGHT bgcolor="#D3D3D3"><font  face="Arial, Helvetica, Helv" size="3" color="#000000"> 176</font></TD>
</TR>
<TR>
 <TD ALIGN=RIGHT bgcolor="#B0B0B0"><font  face="Arial, Helvetica, Helv" size="4" color="#0033AA"><b>  90</b></font></TD>
 <TD ALIGN=RIGHT bgcolor="#D3D3D3"><font  face="Arial, Helvetica, Helv" size="3" color="#000000"> 194</font></TD>
</TR>
<TR>
 <TD ALIGN=RIGHT bgcolor="#B0B0B0"><font  face="Arial, Helvetica, Helv" size="4" color="#0033AA"><b> 100</b></font></TD>
 <TD ALIGN=RIGHT bgcolor="#D3D3D3"><font  face="Arial, Helvetica, Helv" size="3" color="#000000"> 212</font></TD>
</TR>
</tbody>
</TABLE>
</font></CENTER>
</font><SCRIPT LANGUAGE="JavaScript">
<!-- 
// This script is to load all object onLoad() functions 
function startup(){

}

function shutdown(){

}
 
//-->
</SCRIPT>

</BODY>
</HTML>

Any ideas?

Thanks in advance

Robbie
 
Talk to the techie sin charge of whatever server you are running that on. It's probably down to the encoding. Between you, you should be able to fix something up.

Chris
Business Analyst, Code Monkey, Data Wrangler.
SAS Guru.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top