<?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 SAS Enterprise Guide Email Multiple Attachments in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-Enterprise-Guide-Email-Multiple-Attachments/m-p/369225#M24144</link>
    <description>&lt;P&gt;My company has recently switched to SAS Enterprise Guide and I am updating all my codes. One thing that I need to do is send out large batches of&amp;nbsp;emails with attachments.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know that to include .xlsx files you need to add the line&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;content_type=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; lrecl=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;32000&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;to your attach= statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question is, how do you send multiple attachments, of the same or different types, in one email? I have verified that each attachment works individually (I have six total attachments to send), but only the last one attached can be opened.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro emaildata (to_address, attachments);
 Filename output email;
 data _null_;
	file output
	to = (&amp;amp;to_address.)
	subject = "subject"
	attach = (&amp;amp;attachments. content_type="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" lrecl=32000);

 put "text."; 

run;
%mend emaildata;

%emaildata (recipient, "&amp;amp;attachment1." "&amp;amp;attachment2." "&amp;amp;attachment3." "&amp;amp;attachment4." "&amp;amp;attachment5." "&amp;amp;attachment6.");&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 21 Jun 2017 17:24:42 GMT</pubDate>
    <dc:creator>ColeG</dc:creator>
    <dc:date>2017-06-21T17:24:42Z</dc:date>
    <item>
      <title>SAS Enterprise Guide Email Multiple Attachments</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-Enterprise-Guide-Email-Multiple-Attachments/m-p/369225#M24144</link>
      <description>&lt;P&gt;My company has recently switched to SAS Enterprise Guide and I am updating all my codes. One thing that I need to do is send out large batches of&amp;nbsp;emails with attachments.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know that to include .xlsx files you need to add the line&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;content_type=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; lrecl=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;32000&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;to your attach= statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question is, how do you send multiple attachments, of the same or different types, in one email? I have verified that each attachment works individually (I have six total attachments to send), but only the last one attached can be opened.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro emaildata (to_address, attachments);
 Filename output email;
 data _null_;
	file output
	to = (&amp;amp;to_address.)
	subject = "subject"
	attach = (&amp;amp;attachments. content_type="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" lrecl=32000);

 put "text."; 

run;
%mend emaildata;

%emaildata (recipient, "&amp;amp;attachment1." "&amp;amp;attachment2." "&amp;amp;attachment3." "&amp;amp;attachment4." "&amp;amp;attachment5." "&amp;amp;attachment6.");&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Jun 2017 17:24:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-Enterprise-Guide-Email-Multiple-Attachments/m-p/369225#M24144</guid>
      <dc:creator>ColeG</dc:creator>
      <dc:date>2017-06-21T17:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Enterprise Guide Email Multiple Attachments</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-Enterprise-Guide-Email-Multiple-Attachments/m-p/596299#M34918</link>
      <description>&lt;P&gt;This works for me:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	/* email files */
	filename outbox email 'ron@acme.com';

	data _null_;
		file outbox

		/* Overrides value in filename statement */
		to=("&amp;amp;EMAILADDRESS" )
		subject="reports "
		
		attach=
		(
		"&amp;amp;outputpath./&amp;amp;pdbym._results.csv"
		"&amp;amp;outputpath./&amp;amp;pdbym._detail.csv"
		"&amp;amp;outputpath./177_&amp;amp;pdbmy.-&amp;amp;pdemy..html"
		"&amp;amp;outputpath./177_&amp;amp;pdbmy.-&amp;amp;pdemy..pdf"
		"&amp;amp;outputpath./177_&amp;amp;pdbmy.-&amp;amp;pdemy..xlsx"	content_type="application/xlsx" lrecl=32000 	
		"&amp;amp;outputpath./Claims_&amp;amp;pdbmy.-&amp;amp;pdemy..pdf" 
		"&amp;amp;outputpath./Claims_&amp;amp;pdbmy.-&amp;amp;pdemy..html" 
		"&amp;amp;outputpath./Claims_&amp;amp;pdbmy.-&amp;amp;pdemy..rtf"
		"&amp;amp;outputpath./Lines_&amp;amp;pdbmy.-&amp;amp;pdemy..pdf" 
		"&amp;amp;outputpath./Lines_&amp;amp;pdbmy.-&amp;amp;pdemy..html" 
		"&amp;amp;outputpath./Lines_&amp;amp;pdbmy.-&amp;amp;pdemy..rtf"
		"&amp;amp;outputpath./claims30.xlsx" content_type="application/xlsx" lrecl=32000 
		"&amp;amp;outputpath./interest.xlsx" content_type="application/xlsx" lrecl=32000
		"&amp;amp;outputpath./badclaims1.xlsx" content_type="application/xlsx" lrecl=32000
		"&amp;amp;outputpath./badclaims2.xlsx" content_type="application/xlsx" lrecl=32000
		"&amp;amp;outputpath./Detail_File.xlsx" content_type="application/xlsx" lrecl=32000
		)
		;
		
		put "Enjoy these exciting  reports .";
	run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 14 Oct 2019 15:18:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-Enterprise-Guide-Email-Multiple-Attachments/m-p/596299#M34918</guid>
      <dc:creator>tomrvincent</dc:creator>
      <dc:date>2019-10-14T15:18:13Z</dc:date>
    </item>
  </channel>
</rss>

