<?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: Send an email with an embedded table and lines text with macrovariables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Send-an-email-with-an-embedded-table-and-lines-text-with/m-p/794756#M254842</link>
    <description>&lt;P&gt;Thank you very much, it works.&lt;/P&gt;</description>
    <pubDate>Mon, 07 Feb 2022 10:30:09 GMT</pubDate>
    <dc:creator>Abelp9</dc:creator>
    <dc:date>2022-02-07T10:30:09Z</dc:date>
    <item>
      <title>Send an email with an embedded table and lines text with macrovariables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Send-an-email-with-an-embedded-table-and-lines-text-with/m-p/794476#M254751</link>
      <description>&lt;P&gt;I am new to programming in sas and I am creating a daily email report in which I want a file to be attached, showing me some lines of text with macro variables in the body of the message and also attaching the content of a table in the body of the message, so you don't have to open it.&lt;/P&gt;&lt;P&gt;I have achieved everything but the problem is that it sends me 2 emails automatically, 1 with the attached file and the lines of text and another with the image of the table that I want it to show me in the body of the message, how could I solve this so that I I sent it in 1 email only? someone knows? I have seen other methods out there using proc sql and writing the text lines there, but I think that with this I cannot incorporate macro variables to the text lines, so this is important.&lt;/P&gt;&lt;P&gt;Here is the code that I have tested.&lt;/P&gt;&lt;P&gt;```&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;proc import datafile = "xx/xxx/xxx"
 out = TEST
 dbms = dlm
 replace;
 delimiter = '09'x;
 getnames= NO;
run;

proc options option=emailsys;
run;
filename outbox email "xxxx@xxx.com"; 

%MACRO email2;
data _null_;    
   file outbox    
      to=("xxxx@xxxxx")
      cc=("xxxxxx@xxxxx.com") 
      subject="xxxxx" 
      attach = "xxxx/xxxx/xxxx/xxx"
   ;    
 
   put 'xxxxxxx';
   put "xxxxxxxx &amp;amp;macro1 xxxxxx.";
   put "xxxxxxxx &amp;amp;macro2 xxxxxx.";
   put "xxxxxxxx &amp;amp;macro3 xxxxxx.";
   put "xxxxxxxx &amp;amp;macro4 xxxxxx.";
   put "xxxxxxxx &amp;amp;macro5 xxxxxx.";
 
data _null_;
file outbox;
put 'Test.';
run; quit;

FILENAME outbox EMAIL
to=("xxxxx@xxx.com")
subject="test"
CONTENT_TYPE="text/html";

ODS LISTING CLOSE;
ODS HTML BODY=outbox;
PROC PRINT DATA=TEST;
RUN;

ODS HTML CLOSE;
ODS LISTING;
 
run;
%mend email2;
%email2;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;```&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If someone could help me find a solution to send this in 1 email with the macrovariables in the text lines included, I would be very grateful&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Feb 2022 13:21:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Send-an-email-with-an-embedded-table-and-lines-text-with/m-p/794476#M254751</guid>
      <dc:creator>Abelp9</dc:creator>
      <dc:date>2022-02-04T13:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: Send an email with an embedded table and lines text with macrovariables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Send-an-email-with-an-embedded-table-and-lines-text-with/m-p/794607#M254801</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check out this :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How to send email using SAS?&lt;BR /&gt;Posted 06-10-2021 06:03 PM | by ChrisHemedinger&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-send-email-using-SAS/ta-p/746523" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-send-email-using-SAS/ta-p/746523&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Fri, 04 Feb 2022 20:50:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Send-an-email-with-an-embedded-table-and-lines-text-with/m-p/794607#M254801</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2022-02-04T20:50:56Z</dc:date>
    </item>
    <item>
      <title>Re: Send an email with an embedded table and lines text with macrovariables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Send-an-email-with-an-embedded-table-and-lines-text-with/m-p/794746#M254833</link>
      <description>thank you very much for your contribution, in my case I want to import a table into the body of the mail, not an image, that information appears in the document you have sent me (I have not seen how to incorporate the content of a table in the body of the message)</description>
      <pubDate>Mon, 07 Feb 2022 08:26:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Send-an-email-with-an-embedded-table-and-lines-text-with/m-p/794746#M254833</guid>
      <dc:creator>Abelp9</dc:creator>
      <dc:date>2022-02-07T08:26:38Z</dc:date>
    </item>
    <item>
      <title>Re: Send an email with an embedded table and lines text with macrovariables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Send-an-email-with-an-embedded-table-and-lines-text-with/m-p/794749#M254836</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have a look at this section (same Communities Library article) :&lt;/P&gt;
&lt;H2 id="toc-hId--1569898982"&gt;How to format your email with ODS in SAS?&lt;/H2&gt;
&lt;P&gt;You need to write a PROC REPORT or PROC PRINT and use ODS HTML output destination.&lt;BR /&gt;Then your data is displayed in the body of the mail.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;BR /&gt;Koen&lt;/P&gt;</description>
      <pubDate>Mon, 07 Feb 2022 09:21:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Send-an-email-with-an-embedded-table-and-lines-text-with/m-p/794749#M254836</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2022-02-07T09:21:36Z</dc:date>
    </item>
    <item>
      <title>Re: Send an email with an embedded table and lines text with macrovariables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Send-an-email-with-an-embedded-table-and-lines-text-with/m-p/794756#M254842</link>
      <description>&lt;P&gt;Thank you very much, it works.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Feb 2022 10:30:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Send-an-email-with-an-embedded-table-and-lines-text-with/m-p/794756#M254842</guid>
      <dc:creator>Abelp9</dc:creator>
      <dc:date>2022-02-07T10:30:09Z</dc:date>
    </item>
  </channel>
</rss>

