<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Data Step Email with HTML formatted body? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Data-Step-Email-with-HTML-formatted-body/m-p/30134#M5727</link>
    <description>Does this help?&lt;BR /&gt;
&lt;BR /&gt;
filename gwc email ' '&lt;BR /&gt;
    to=("galvwarmerreport@hamilton.ca")&lt;BR /&gt;
    subject="Galvanize Warmer Consumption for &amp;amp;start to &amp;amp;end"&lt;BR /&gt;
	  type="text/html";&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
&lt;BR /&gt;
file gwc;&lt;BR /&gt;
  put "&lt;BR /&gt;&lt;FONT color="blue" face="helvetica"&gt;&lt;BR /&gt;
       another SAS® powered auto e-mail report from Quality Systems";&lt;BR /&gt;
  put "&lt;BR /&gt;  ";&lt;BR /&gt;
  put "&lt;BR /&gt;Click on the link below to view/print file contents";                                                                                                                                                                                                    &lt;BR /&gt;
  put "&lt;BR /&gt; ";                                                                                                                                                                                                                                                      &lt;BR /&gt;
  put "&lt;BR /&gt; &lt;A&gt;&lt;BR /&gt;
      HREF='\\MOFtp\MainFrameFtp\EsaDown\GalvWarmerTracking.pdf'&amp;gt;&lt;BR /&gt;
            Galvanize Warmer Consumption&lt;/A&gt;&lt;BR /&gt;"; &lt;BR /&gt;
  put "&lt;BR /&gt; ";&lt;BR /&gt;
  put "&lt;BR /&gt; ";&lt;BR /&gt;
  put "&lt;BR /&gt; Questions, comments or concerns?";&lt;BR /&gt;
  put "&lt;BR /&gt; Send reply email to: Quality Systems Reports";&lt;BR /&gt;
run;

This didn't display properly.  Let me try again.&lt;BR /&gt;
&lt;BR /&gt;
    &lt;BR /&gt;
Message was edited by: Bill&lt;/FONT&gt;</description>
    <pubDate>Wed, 09 Jul 2008 20:05:06 GMT</pubDate>
    <dc:creator>Bill</dc:creator>
    <dc:date>2008-07-09T20:05:06Z</dc:date>
    <item>
      <title>Data Step Email with HTML formatted body?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Step-Email-with-HTML-formatted-body/m-p/30133#M5726</link>
      <description>Hi,&lt;BR /&gt;
I am trying to send an email from the datastep, I have a sample program that generates the email and sends it.  That works great! However, I would like to have the body of the email display in HTML, currently I get the text display (I see the html tags. If I save the text to a file and open that with a browser it displays as I want.)  What I want is the email body to display as formatted HTML.&lt;BR /&gt;
&lt;BR /&gt;
Here is the start/end of the body of the message&lt;BR /&gt;
&lt;FONT color="navy"&gt;&lt;PRE&gt; &lt;FONT face="Times" new="" roman=""&gt;Dear Gerry ,&lt;BR /&gt;
...&lt;BR /&gt;
&lt;BR /&gt;
&lt;/FONT&gt;&lt;/PRE&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;FONT face="arial" color="black"&gt;&lt;BR /&gt;
and the code I use including the filename and portionst of the datasetep:&lt;BR /&gt;
&lt;FONT color="navy"&gt;&lt;BR /&gt;
filename mailbox email to="&amp;amp;memail1"&lt;BR /&gt;
                 subject ='test email'&lt;BR /&gt;
                 type="text/html";&lt;BR /&gt;
data _null_;&lt;BR /&gt;
  set list end=lastobs;&lt;BR /&gt;
  file mailbox;  &lt;BR /&gt;
 if _n_ = 1 then do;&lt;BR /&gt;
&lt;BR /&gt;
put '' &lt;BR /&gt;
''&lt;BR /&gt;
'&lt;FONT color="navy"&gt;'&lt;BR /&gt;
'&lt;PRE&gt;';&lt;BR /&gt;
end;&lt;BR /&gt;
&lt;BR /&gt;
/* Heading using name*/&lt;BR /&gt;
pname=trim("&amp;amp;mname1")!! ' ,';&lt;BR /&gt;
put '&lt;FONT face="Times" new="" roman=""&gt;Dear ' pName;&lt;BR /&gt;
&lt;BR /&gt;
...&lt;BR /&gt;
*  write out close of html;&lt;BR /&gt;
&lt;BR /&gt;
if lastobs then do;&lt;BR /&gt;
put '&lt;/FONT&gt;&lt;/PRE&gt;'&lt;BR /&gt;
''&lt;BR /&gt;
'';&lt;BR /&gt;
end;&lt;BR /&gt;
&lt;BR /&gt;
Run;&lt;BR /&gt;
&lt;FONT color="black"&gt;&lt;BR /&gt;
Is there a way to send the body of an email from the data step as HTML?&lt;BR /&gt;
I looked, and there is lots of great info about emailing from SAS, but I could not find a way to format the datastep body as html.  There is lots to show as a file attachment, or PROC output, neither of which works for me.&lt;BR /&gt;
Erik has a great paper at &lt;A href="http://www2.sas.com/proceedings/forum2008/038-2008.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/forum2008/038-2008.pdf&lt;/A&gt;&lt;BR /&gt;
but that doesn't help with using the data step to create HTML as the body of the email.&lt;BR /&gt;
Thanks for any info,&lt;BR /&gt;
Gerry&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;</description>
      <pubDate>Wed, 09 Jul 2008 15:45:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Step-Email-with-HTML-formatted-body/m-p/30133#M5726</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-07-09T15:45:40Z</dc:date>
    </item>
    <item>
      <title>Re: Data Step Email with HTML formatted body?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-Step-Email-with-HTML-formatted-body/m-p/30134#M5727</link>
      <description>Does this help?&lt;BR /&gt;
&lt;BR /&gt;
filename gwc email ' '&lt;BR /&gt;
    to=("galvwarmerreport@hamilton.ca")&lt;BR /&gt;
    subject="Galvanize Warmer Consumption for &amp;amp;start to &amp;amp;end"&lt;BR /&gt;
	  type="text/html";&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
&lt;BR /&gt;
file gwc;&lt;BR /&gt;
  put "&lt;BR /&gt;&lt;FONT color="blue" face="helvetica"&gt;&lt;BR /&gt;
       another SAS® powered auto e-mail report from Quality Systems";&lt;BR /&gt;
  put "&lt;BR /&gt;  ";&lt;BR /&gt;
  put "&lt;BR /&gt;Click on the link below to view/print file contents";                                                                                                                                                                                                    &lt;BR /&gt;
  put "&lt;BR /&gt; ";                                                                                                                                                                                                                                                      &lt;BR /&gt;
  put "&lt;BR /&gt; &lt;A&gt;&lt;BR /&gt;
      HREF='\\MOFtp\MainFrameFtp\EsaDown\GalvWarmerTracking.pdf'&amp;gt;&lt;BR /&gt;
            Galvanize Warmer Consumption&lt;/A&gt;&lt;BR /&gt;"; &lt;BR /&gt;
  put "&lt;BR /&gt; ";&lt;BR /&gt;
  put "&lt;BR /&gt; ";&lt;BR /&gt;
  put "&lt;BR /&gt; Questions, comments or concerns?";&lt;BR /&gt;
  put "&lt;BR /&gt; Send reply email to: Quality Systems Reports";&lt;BR /&gt;
run;

This didn't display properly.  Let me try again.&lt;BR /&gt;
&lt;BR /&gt;
    &lt;BR /&gt;
Message was edited by: Bill&lt;/FONT&gt;</description>
      <pubDate>Wed, 09 Jul 2008 20:05:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-Step-Email-with-HTML-formatted-body/m-p/30134#M5727</guid>
      <dc:creator>Bill</dc:creator>
      <dc:date>2008-07-09T20:05:06Z</dc:date>
    </item>
  </channel>
</rss>

