<?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 sending emails from sas proc sql not working in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/sending-emails-from-sas-proc-sql-not-working/m-p/464028#M29950</link>
    <description>&lt;P&gt;The following code generate&amp;nbsp; a report .&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;SELECT&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; PROMO_NBR, PROMO_DESC, Count(PID) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; Total &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;FROM&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; eza_lead_report &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;GROUP&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;BY&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; PROMO_NBR, PROMO_DESC;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;quit&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;The report should shared by email.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Error message :&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;ERROR: Email: The connection was refused.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Email code for using :&lt;/P&gt;&lt;P&gt;...............................................................................................................................................................&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;FILENAME&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; outmail &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;EMAIL&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;SUBJECT&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"Results as of %sysfunc(date(),yymmdd10.)"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;FROM&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;= &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"ex10testq@mtbdev.com"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;TO&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;= &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"pmuttineni_contractor@mtb.com"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;ATTACH&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;= &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"/madata/MAExports/LeadFiles/data.pdf"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;FILENAME&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; output &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;EMAIL&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;SUBJECT&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;= &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"EZA Leads Report Summary"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;FROM&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;= &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"ex10testq@mtbdev.com"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;TO&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;= &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"pmuttineni_contractor@mtb.com"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;CT&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;= &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"text/html"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;ODS&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;HTML&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;BODY&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=output &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;STYLE&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=sasweb;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;TITLE&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;JUSTIFY&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=left&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"Total Sales by Country and Product type as of %sysfunc(date(),yymmdd10.)"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*PROC REPORT DATA=eza_lead_report NOWD&lt;/P&gt;&lt;P&gt;STYLE(REPORT)=[PREHTML="&amp;lt;hr&amp;gt;"] ;&lt;/P&gt;&lt;P&gt;COLUMNS PROMO_NBR PROMO_DESC,Count;&lt;/P&gt;&lt;P&gt;DEFINE PROMO_NBR /GROUP;&lt;/P&gt;&lt;P&gt;DEFINE PROMO_DESC/GROUP;&lt;/P&gt;&lt;P&gt;DEFINE PID/SUM ;&lt;/P&gt;&lt;P&gt;RUN;*/&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;title1&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="3"&gt;"Report genarated on %sysfunc(date(),worddate18.)"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt; ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;create&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;table&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; eza_lead_report &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;as&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; * &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; Standard;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;SELECT&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; PROMO_NBR, PROMO_DESC, Count(PID) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; Total &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;FROM&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; eza_lead_report &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;GROUP&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;BY&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; PROMO_NBR, PROMO_DESC;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;quit&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;ODS&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;HTML&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;CLOSE&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;DATA&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;_NULL_&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;FILE&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; outmail;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;PUT&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="3"&gt;"Here are the results for your last query"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;RUN&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 22 May 2018 13:06:36 GMT</pubDate>
    <dc:creator>Pavan4</dc:creator>
    <dc:date>2018-05-22T13:06:36Z</dc:date>
    <item>
      <title>sending emails from sas proc sql not working</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/sending-emails-from-sas-proc-sql-not-working/m-p/464028#M29950</link>
      <description>&lt;P&gt;The following code generate&amp;nbsp; a report .&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;SELECT&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; PROMO_NBR, PROMO_DESC, Count(PID) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; Total &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;FROM&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; eza_lead_report &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;GROUP&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;BY&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; PROMO_NBR, PROMO_DESC;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;quit&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;The report should shared by email.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Error message :&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;ERROR: Email: The connection was refused.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Email code for using :&lt;/P&gt;&lt;P&gt;...............................................................................................................................................................&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;FILENAME&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; outmail &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;EMAIL&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;SUBJECT&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"Results as of %sysfunc(date(),yymmdd10.)"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;FROM&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;= &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"ex10testq@mtbdev.com"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;TO&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;= &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"pmuttineni_contractor@mtb.com"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;ATTACH&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;= &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"/madata/MAExports/LeadFiles/data.pdf"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;FILENAME&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; output &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;EMAIL&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;SUBJECT&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;= &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"EZA Leads Report Summary"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;FROM&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;= &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"ex10testq@mtbdev.com"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;TO&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;= &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"pmuttineni_contractor@mtb.com"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;CT&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;= &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"text/html"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;ODS&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;HTML&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;BODY&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=output &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;STYLE&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=sasweb;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;TITLE&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;JUSTIFY&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=left&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"Total Sales by Country and Product type as of %sysfunc(date(),yymmdd10.)"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*PROC REPORT DATA=eza_lead_report NOWD&lt;/P&gt;&lt;P&gt;STYLE(REPORT)=[PREHTML="&amp;lt;hr&amp;gt;"] ;&lt;/P&gt;&lt;P&gt;COLUMNS PROMO_NBR PROMO_DESC,Count;&lt;/P&gt;&lt;P&gt;DEFINE PROMO_NBR /GROUP;&lt;/P&gt;&lt;P&gt;DEFINE PROMO_DESC/GROUP;&lt;/P&gt;&lt;P&gt;DEFINE PID/SUM ;&lt;/P&gt;&lt;P&gt;RUN;*/&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;title1&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="3"&gt;"Report genarated on %sysfunc(date(),worddate18.)"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt; ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;create&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;table&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; eza_lead_report &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;as&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; * &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; Standard;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;SELECT&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; PROMO_NBR, PROMO_DESC, Count(PID) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; Total &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;FROM&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; eza_lead_report &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;GROUP&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;BY&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; PROMO_NBR, PROMO_DESC;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;quit&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;ODS&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;HTML&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;CLOSE&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;DATA&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;_NULL_&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;FILE&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; outmail;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;PUT&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="3"&gt;"Here are the results for your last query"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;RUN&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 May 2018 13:06:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/sending-emails-from-sas-proc-sql-not-working/m-p/464028#M29950</guid>
      <dc:creator>Pavan4</dc:creator>
      <dc:date>2018-05-22T13:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: sending emails from sas proc sql not working</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/sending-emails-from-sas-proc-sql-not-working/m-p/464034#M29951</link>
      <description>&lt;P&gt;You need to make sure that your SMTP access is correctly configured into SAS.&lt;/P&gt;
&lt;P&gt;See here: &lt;A href="http://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.3&amp;amp;docsetId=lesysoptsref&amp;amp;docsetTarget=p0r3gu6wvyq0l0n1gkadgl7iukfm.htm&amp;amp;locale=en" target="_blank"&gt;http://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.3&amp;amp;docsetId=lesysoptsref&amp;amp;docsetTarget=p0r3gu6wvyq0l0n1gkadgl7iukfm.htm&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;(Category Communications: email)&lt;/P&gt;
&lt;P&gt;And your code would send two emails, as the ods html close would close the first email, and the data step another one.&lt;/P&gt;
&lt;P&gt;Your final piece of code should be&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
file print;
put "Here are the results for your last query";
run;

ods html close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You could also use ods text to insert text into the stream.&lt;/P&gt;</description>
      <pubDate>Tue, 22 May 2018 13:26:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/sending-emails-from-sas-proc-sql-not-working/m-p/464034#M29951</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-05-22T13:26:04Z</dc:date>
    </item>
  </channel>
</rss>

