<?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: Using PROC HTTP to POST a mail with Zipped file attachments from SAS Studio in SAS Viya</title>
    <link>https://communities.sas.com/t5/SAS-Viya/Using-PROC-HTTP-to-POST-a-mail-with-Zipped-file-attachments-from/m-p/923260#M2320</link>
    <description>Logs showing 200 Response and without any Errors. Also i have received the mail. But without the attachments.</description>
    <pubDate>Sat, 06 Apr 2024 01:46:13 GMT</pubDate>
    <dc:creator>Sathyaseelan_C</dc:creator>
    <dc:date>2024-04-06T01:46:13Z</dc:date>
    <item>
      <title>Using PROC HTTP to POST a mail with Zipped file attachments from SAS Studio</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Using-PROC-HTTP-to-POST-a-mail-with-Zipped-file-attachments-from/m-p/923156#M2317</link>
      <description>&lt;P&gt;I am using the below Json for posting the Mail using our SAS STUDIO from SAS VIYA 3.5 ENV,.&lt;BR /&gt;&lt;BR /&gt;I am getting 200 Response and have received the mail. But not with the attachments. Kindly advise.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;data test;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;file mail;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;put '{'&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;/'"to":'&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;/'['&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;/'{'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;/'"address": "sathyaseelan_chandramohan@example.com",'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;/'"personal": "Example User"'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;/'}'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;/'],'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;/'"from": {'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;/'"address": "sathyaseelan_chandramohan@example.com"'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;/'},'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;/'"subject": "Subject goes here",'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;/'"htmlMessage": "&amp;lt;html&amp;gt;&amp;lt;b&amp;gt;Note:&amp;lt;/b&amp;gt;This is an HTML email.&amp;lt;/html&amp;gt;",'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;/'"attachment": ['&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;/'{'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; /'"type": "application/x-zip",'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; /'"name": "Summary_SR_20240405_1334.zip",'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; /'"data": "/tmp/Summary_SR_20240405_1334.zip"'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;/'}'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;/']' &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;/'}'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;data _null_;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;infile mail;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;input;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;put _infile_;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;filename resp clear;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;filename resp temp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;options set=SSLREQCERT="allow";&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;/*Invoke create parent SR API*/&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;proc http&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;url="&lt;A href="https://example.com/mail/messages" target="_blank" rel="noopener"&gt;https://example.com/mail/messages&lt;/A&gt;"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;method="POST"&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;out=resp&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CLEAR_CACHE&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;in=mail;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;debug level=2;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;headers&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"Authorization" = "Bearer &amp;amp;access_token"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"Content-type" = "application/vnd.sas.mail+json";&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;%put &amp;amp;=SYS_PROCHTTP_STATUS_CODE;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 05 Apr 2024 12:52:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Using-PROC-HTTP-to-POST-a-mail-with-Zipped-file-attachments-from/m-p/923156#M2317</guid>
      <dc:creator>Sathyaseelan_C</dc:creator>
      <dc:date>2024-04-05T12:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: Using PROC HTTP to POST a mail with Zipped file attachments from SAS Studio</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Using-PROC-HTTP-to-POST-a-mail-with-Zipped-file-attachments-from/m-p/923172#M2319</link>
      <description>&lt;P&gt;What does the log show?&lt;/P&gt;</description>
      <pubDate>Fri, 05 Apr 2024 13:45:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Using-PROC-HTTP-to-POST-a-mail-with-Zipped-file-attachments-from/m-p/923172#M2319</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-04-05T13:45:16Z</dc:date>
    </item>
    <item>
      <title>Re: Using PROC HTTP to POST a mail with Zipped file attachments from SAS Studio</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Using-PROC-HTTP-to-POST-a-mail-with-Zipped-file-attachments-from/m-p/923260#M2320</link>
      <description>Logs showing 200 Response and without any Errors. Also i have received the mail. But without the attachments.</description>
      <pubDate>Sat, 06 Apr 2024 01:46:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Using-PROC-HTTP-to-POST-a-mail-with-Zipped-file-attachments-from/m-p/923260#M2320</guid>
      <dc:creator>Sathyaseelan_C</dc:creator>
      <dc:date>2024-04-06T01:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using PROC HTTP to POST a mail with Zipped file attachments from SAS Studio</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Using-PROC-HTTP-to-POST-a-mail-with-Zipped-file-attachments-from/m-p/923332#M2321</link>
      <description>&lt;P&gt;If it is the intention to send email with http post request and if you are open to looking at python, then please have a look at &lt;BR /&gt;&lt;A href="https://stackoverflow.com/questions/58242068/i-want-to-send-file-as-attachment-to-an-api-post-request" target="_blank"&gt;https://stackoverflow.com/questions/58242068/i-want-to-send-file-as-attachment-to-an-api-post-request&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 07 Apr 2024 13:45:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Using-PROC-HTTP-to-POST-a-mail-with-Zipped-file-attachments-from/m-p/923332#M2321</guid>
      <dc:creator>Sajid01</dc:creator>
      <dc:date>2024-04-07T13:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: Using PROC HTTP to POST a mail with Zipped file attachments from SAS Studio</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Using-PROC-HTTP-to-POST-a-mail-with-Zipped-file-attachments-from/m-p/923400#M2323</link>
      <description>The "data" of the attachment array needs to be the actual contents of the file rather than a pointer to the file, PROC HTTP would not know to resolve that to the physical file and then properly encode it, it is sending to the mail service literally "/tmp/Summary_SR_20240405_1334.zip".&lt;BR /&gt;&lt;BR /&gt;I think you'd need to base64 encode the file and put it in the "mail" file.</description>
      <pubDate>Mon, 08 Apr 2024 13:09:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Using-PROC-HTTP-to-POST-a-mail-with-Zipped-file-attachments-from/m-p/923400#M2323</guid>
      <dc:creator>gwootton</dc:creator>
      <dc:date>2024-04-08T13:09:01Z</dc:date>
    </item>
  </channel>
</rss>

