<?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: SMTP building body of e-mail issue in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/SMTP-building-body-of-e-mail-issue/m-p/505550#M21905</link>
    <description>&lt;P&gt;Another method to put text into ODS output is the &lt;FONT face="courier new,courier"&gt;ods text&lt;/FONT&gt; statement. I've never fiddled around with manually writing tags to an email, though.&lt;/P&gt;
&lt;P&gt;Such things I do when writing output to a file:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let outfile=/path/destination.html;

ods html file="&amp;amp;outfile" (no_bottom_matter);
ods html close;

filename out "&amp;amp;outfile" mod;

data _null_;
file out;
/* put html tagged text here */
run;

ods html file=out (no_top_matter);

/* further ods output */

ods html close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You could now write the resulting file to the email without using ods.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
infile "&amp;amp;outfile";
file email;
input;
put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 18 Oct 2018 13:49:01 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-10-18T13:49:01Z</dc:date>
    <item>
      <title>SMTP building body of e-mail issue</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/SMTP-building-body-of-e-mail-issue/m-p/505528#M21901</link>
      <description>&lt;P&gt;Trying to accomplish one e-mail but get either two separate e-mails or missing data, depending on ODS statement placement:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options emailsys=SMTP;
options emailhost='mail.from.me.host';
filename sendemail mail
 to=("recepient@mail.com")
 from=("sender@mail.com")
 subject="I suck at SAS"
 type="text/html"
 attach=("/required/email/signature/logo/logo.png" inlined='pic');

/* If ODS statement placed here; no data _null_ verbiage in body of email */
ods html3 body sendemail rs=none style=sasweb;

data _null_;
 put '&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;';
 put 'All,&amp;lt;br&amp;gt; Below are the requested metrics for'"&amp;amp;date"':'&amp;lt;br&amp;gt;;
 put 'Regards,&amp;lt;br&amp;gt;';
 put '&amp;lt;font size="18" face="mistral"&amp;gt;GI Jeff&amp;lt;br&amp;gt;';
 put '&amp;lt;img src=cid:pic&amp;gt;';                     
 put '&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;';
run;

/* if ODS statement placed here; two separate e-mails containing data _null_ and proc print */
ods html3 body sendemail rs=none style=sasweb;

proc print data=test_data;
 where date=&amp;amp;date;
 title "Metrics for &amp;amp;date";
run;

ods html close;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Oct 2018 13:24:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/SMTP-building-body-of-e-mail-issue/m-p/505528#M21901</guid>
      <dc:creator>G_I_Jeff</dc:creator>
      <dc:date>2018-10-18T13:24:28Z</dc:date>
    </item>
    <item>
      <title>Re: SMTP building body of e-mail issue</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/SMTP-building-body-of-e-mail-issue/m-p/505532#M21902</link>
      <description>&lt;P&gt;Add a&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;file print;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;in your data _null_ step, so that the put's end up in ods and not in the log.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Oct 2018 13:31:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/SMTP-building-body-of-e-mail-issue/m-p/505532#M21902</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-10-18T13:31:06Z</dc:date>
    </item>
    <item>
      <title>Re: SMTP building body of e-mail issue</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/SMTP-building-body-of-e-mail-issue/m-p/505533#M21903</link>
      <description>&lt;P&gt;And remove the first and last put in the data _null_. That part is handled by ods html on its own.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Oct 2018 13:33:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/SMTP-building-body-of-e-mail-issue/m-p/505533#M21903</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-10-18T13:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: SMTP building body of e-mail issue</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/SMTP-building-body-of-e-mail-issue/m-p/505536#M21904</link>
      <description>&lt;P&gt;Kurt,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks, that got me half way. Put by putting file print; in the data _null_ step, it does not render the html then. I see all the tags in the body of the e-mail. And thanks for the tip of the &amp;lt;html&amp;gt; &amp;amp; &amp;lt;body&amp;gt; tags. I assumed that but I'm just fooling around at this point and coded them in.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jeff&lt;/P&gt;</description>
      <pubDate>Thu, 18 Oct 2018 13:38:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/SMTP-building-body-of-e-mail-issue/m-p/505536#M21904</guid>
      <dc:creator>G_I_Jeff</dc:creator>
      <dc:date>2018-10-18T13:38:44Z</dc:date>
    </item>
    <item>
      <title>Re: SMTP building body of e-mail issue</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/SMTP-building-body-of-e-mail-issue/m-p/505550#M21905</link>
      <description>&lt;P&gt;Another method to put text into ODS output is the &lt;FONT face="courier new,courier"&gt;ods text&lt;/FONT&gt; statement. I've never fiddled around with manually writing tags to an email, though.&lt;/P&gt;
&lt;P&gt;Such things I do when writing output to a file:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let outfile=/path/destination.html;

ods html file="&amp;amp;outfile" (no_bottom_matter);
ods html close;

filename out "&amp;amp;outfile" mod;

data _null_;
file out;
/* put html tagged text here */
run;

ods html file=out (no_top_matter);

/* further ods output */

ods html close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You could now write the resulting file to the email without using ods.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
infile "&amp;amp;outfile";
file email;
input;
put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Oct 2018 13:49:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/SMTP-building-body-of-e-mail-issue/m-p/505550#M21905</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-10-18T13:49:01Z</dc:date>
    </item>
  </channel>
</rss>

