<?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: email table and with attachment in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/email-table-and-with-attachment/m-p/418369#M102767</link>
    <description>Hi. Thanks for your response.&lt;BR /&gt;&lt;BR /&gt;The code runs. But it sends two emails.&lt;BR /&gt;&lt;BR /&gt;I want all of the content to be sent in one email.&lt;BR /&gt;</description>
    <pubDate>Tue, 05 Dec 2017 05:03:50 GMT</pubDate>
    <dc:creator>micheal_page</dc:creator>
    <dc:date>2017-12-05T05:03:50Z</dc:date>
    <item>
      <title>email table and with attachment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/email-table-and-with-attachment/m-p/418231#M102728</link>
      <description>&lt;P&gt;HI.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking for help with a current challenge.&amp;nbsp; &amp;nbsp;Hopefully this is an easy request.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can send emails with an html table in the body and I can seen emails with attachments and text in the body, but I have not found a way to combine both of these.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to send a email that has a summary table and comments in the body with an attachment or attachments.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS.&amp;nbsp; &amp;nbsp;this is for a 9.3 environment running in linux&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my sample code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*email 1 attachment and text*/&lt;/P&gt;&lt;P&gt;FILENAME mymail EMAIL Attach="/appl/users/adminreports/exports/pdf/EarlyWarningTest.pdf"&lt;BR /&gt;from=("DoNotReply@email.com")&lt;BR /&gt;to=("user@email.com")&lt;BR /&gt;cc=("" )&lt;/P&gt;&lt;P&gt;subject="Early Warning Trends";&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;file mymail;&lt;/P&gt;&lt;P&gt;put 'This is a test.';&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;run; quit;&lt;/P&gt;&lt;P&gt;/*Email 2 html table*/&lt;/P&gt;&lt;P&gt;FILENAME mymail EMAIL&lt;BR /&gt;to=("user@email.com")&lt;BR /&gt;from=("DoNotReply@whirlpool.com")&lt;BR /&gt;subject="Early Warning Trends"&lt;BR /&gt;CONTENT_TYPE="text/html";&lt;/P&gt;&lt;P&gt;ODS LISTING CLOSE;&lt;BR /&gt;ODS HTML BODY=mymail;&lt;BR /&gt;PROC PRINT DATA=work.FLAGS_ALERT_1_TEST_2;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;ODS HTML CLOSE;&lt;BR /&gt;ODS LISTING;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2017 17:36:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/email-table-and-with-attachment/m-p/418231#M102728</guid>
      <dc:creator>micheal_page</dc:creator>
      <dc:date>2017-12-04T17:36:43Z</dc:date>
    </item>
    <item>
      <title>Re: email table and with attachment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/email-table-and-with-attachment/m-p/418365#M102765</link>
      <description>&lt;P&gt;What happens when your program runs? errors? email not as expected?&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2017 04:31:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/email-table-and-with-attachment/m-p/418365#M102765</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2017-12-05T04:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: email table and with attachment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/email-table-and-with-attachment/m-p/418369#M102767</link>
      <description>Hi. Thanks for your response.&lt;BR /&gt;&lt;BR /&gt;The code runs. But it sends two emails.&lt;BR /&gt;&lt;BR /&gt;I want all of the content to be sent in one email.&lt;BR /&gt;</description>
      <pubDate>Tue, 05 Dec 2017 05:03:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/email-table-and-with-attachment/m-p/418369#M102767</guid>
      <dc:creator>micheal_page</dc:creator>
      <dc:date>2017-12-05T05:03:50Z</dc:date>
    </item>
    <item>
      <title>Re: email table and with attachment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/email-table-and-with-attachment/m-p/418662#M102866</link>
      <description>&lt;P&gt;Mmm I am having trouble too.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is what I could do&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data TEST; file "%sysfunc(pathname(work))/em.txt";  X=1; put X;run;

filename MYMAIL email attach      ="%sysfunc(pathname(work))/em.txt"
                      from        ="DoNotReply@email.com"
                      to          ="m771879@westpac.co.nz"
                      subject     ="test"
                      content_type="text/html" ;

ods listing close;

ods html file=MYMAIL(nobot);

option nocenter;
proc sql;
  select '&amp;lt;a&amp;gt;Hi all,&amp;lt;p&amp;gt;Here is the lastest report.&amp;lt;/a&amp;gt;' from test(obs=1);
quit; 

option center;
proc print data=TEST;
run;
   
option nocenter;
proc sql;
  select '&amp;lt;a&amp;gt;Regards,&amp;lt;p&amp;gt;Your SAS guru&amp;lt;/a&amp;gt;' from test(obs=1);
quit; 

ods html close;

ods listing;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;which displays like this in Outlook:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/17041i2CCA8BDBA771A063/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2017 01:51:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/email-table-and-with-attachment/m-p/418662#M102866</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2017-12-06T01:51:57Z</dc:date>
    </item>
    <item>
      <title>Re: email table and with attachment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/email-table-and-with-attachment/m-p/418790#M102903</link>
      <description>This is working great. Thank you so much!</description>
      <pubDate>Wed, 06 Dec 2017 13:47:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/email-table-and-with-attachment/m-p/418790#M102903</guid>
      <dc:creator>micheal_page</dc:creator>
      <dc:date>2017-12-06T13:47:33Z</dc:date>
    </item>
    <item>
      <title>Re: email table and with attachment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/email-table-and-with-attachment/m-p/449240#M113038</link>
      <description>&lt;P&gt;this code is not working and gives me below error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;error line 49&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 The SAS System 12:03 Wednesday, March 28, 2018&lt;/P&gt;&lt;P&gt;1 ;*';*";*/;quit;run;&lt;BR /&gt;2 OPTIONS PAGENO=MIN;&lt;BR /&gt;3 %LET _CLIENTTASKLABEL='Program (3)';&lt;BR /&gt;4 %LET _CLIENTPROJECTPATH='';&lt;BR /&gt;5 %LET _CLIENTPROJECTNAME='';&lt;BR /&gt;6 %LET _SASPROGRAMFILE=;&lt;BR /&gt;7&lt;BR /&gt;8 ODS _ALL_ CLOSE;&lt;BR /&gt;9 OPTIONS DEV=ACTIVEX;&lt;BR /&gt;10 GOPTIONS XPIXELS=0 YPIXELS=0;&lt;BR /&gt;11 FILENAME EGSR TEMP;&lt;BR /&gt;12 ODS tagsets.sasreport13(ID=EGSR) FILE=EGSR&lt;BR /&gt;13 STYLE=HtmlBlue&lt;BR /&gt;14 STYLESHEET=(URL="file:///C:/Program%20Files/SASHome/SASEnterpriseGuide/7.1/Styles/HtmlBlue.css")&lt;BR /&gt;15 NOGTITLE&lt;BR /&gt;16 NOGFOOTNOTE&lt;BR /&gt;17 GPATH=&amp;amp;sasworklocation&lt;BR /&gt;18 ENCODING=UTF8&lt;BR /&gt;19 options(rolap="on")&lt;BR /&gt;20 ;&lt;BR /&gt;NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR&lt;BR /&gt;21&lt;BR /&gt;22 GOPTIONS ACCESSIBLE;&lt;BR /&gt;23 data TEST; file "%sysfunc(pathname(work))/em.txt"; X=1; put X;run;&lt;/P&gt;&lt;P&gt;NOTE: The file "F:\work\_TD19524_AUMISSAS_\Prc2/em.txt" is:&lt;BR /&gt;Filename=F:\work\_TD19524_AUMISSAS_\Prc2\em.txt,&lt;BR /&gt;RECFM=V,LRECL=32767,File Size (bytes)=0,&lt;BR /&gt;Last Modified=28Mar2018:13:23:37,&lt;BR /&gt;Create Time=28Mar2018:13:23:37&lt;/P&gt;&lt;P&gt;NOTE: 1 record was written to the file "F:\work\_TD19524_AUMISSAS_\Prc2/em.txt".&lt;BR /&gt;The minimum record length was 1.&lt;BR /&gt;The maximum record length was 1.&lt;BR /&gt;NOTE: The data set WORK.TEST has 1 observations and 1 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;24&lt;BR /&gt;25 filename MYMAIL email attach ="%sysfunc(pathname(work))/em.txt"&lt;BR /&gt;26&lt;BR /&gt;27 to ="arpit.agarwal@aubank.in"&lt;BR /&gt;28 subject ="test"&lt;BR /&gt;29 content_type="text/html" ;&lt;BR /&gt;30&lt;BR /&gt;31 ods listing close;&lt;BR /&gt;32&lt;BR /&gt;33 ods html file=MYMAIL(nobot);&lt;BR /&gt;NOTE: Writing HTML Body file: MYMAIL&lt;BR /&gt;34&lt;BR /&gt;35 option nocenter;&lt;BR /&gt;36 proc sql;&lt;BR /&gt;37 select '&amp;lt;a&amp;gt;Hi all,&amp;lt;p&amp;gt;Here is the lastest report.&amp;lt;/a&amp;gt;' from test(obs=1);&lt;BR /&gt;38 quit;&lt;BR /&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;real time 0.03 seconds&lt;BR /&gt;2 The SAS System 12:03 Wednesday, March 28, 2018&lt;/P&gt;&lt;P&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;39&lt;BR /&gt;40 option center;&lt;BR /&gt;41 proc print data=TEST;&lt;BR /&gt;42 run;&lt;/P&gt;&lt;P&gt;NOTE: There were 1 observations read from the data set WORK.TEST.&lt;BR /&gt;NOTE: PROCEDURE PRINT used (Total process time):&lt;BR /&gt;real time 0.02 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;43&lt;BR /&gt;44 option nocenter;&lt;BR /&gt;45 proc sql;&lt;BR /&gt;46 select '&amp;lt;a&amp;gt;Regards,&amp;lt;p&amp;gt;Your SAS guru&amp;lt;/a&amp;gt;' from test(obs=1);&lt;BR /&gt;47 quit;&lt;BR /&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;48&lt;BR /&gt;49 ods html close;&lt;BR /&gt;ERROR: Encryption Error: Invalid parameter.&lt;BR /&gt;50&lt;BR /&gt;51 ods listing;&lt;BR /&gt;52&lt;BR /&gt;53 GOPTIONS NOACCESSIBLE;&lt;BR /&gt;54 %LET _CLIENTTASKLABEL=;&lt;BR /&gt;55 %LET _CLIENTPROJECTPATH=;&lt;BR /&gt;56 %LET _CLIENTPROJECTNAME=;&lt;BR /&gt;57 %LET _SASPROGRAMFILE=;&lt;BR /&gt;58&lt;BR /&gt;59 ;*';*";*/;quit;run;&lt;BR /&gt;60 ODS _ALL_ CLOSE;&lt;BR /&gt;61&lt;BR /&gt;62&lt;BR /&gt;63 QUIT; RUN;&lt;BR /&gt;64&lt;/P&gt;</description>
      <pubDate>Wed, 28 Mar 2018 07:56:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/email-table-and-with-attachment/m-p/449240#M113038</guid>
      <dc:creator>arpitagarwal512</dc:creator>
      <dc:date>2018-03-28T07:56:33Z</dc:date>
    </item>
  </channel>
</rss>

