<?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 Example for sending email using REST Api in SAS Viya</title>
    <link>https://communities.sas.com/t5/SAS-Viya/Example-for-sending-email-using-REST-Api/m-p/888352#M1966</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was hoping someone can give me an example of sending an email with an attachment using a curl command to call the REST Api.&lt;/P&gt;&lt;P&gt;I have been searching without much luck, but have been able to put together the below code from example I found, but it doesn't include an attachment.&lt;BR /&gt;&lt;BR /&gt;curl -s -k -X POST "$SAS_SERVICES_URL/mail/messages" -H "Authorization: Bearer $SAS_CLIENT_TOKEN" -H 'Content-Type: application/vnd.sas.mail+json' -d '{"to": [{"address": "test@test"}],"from":{"address": "user@test"},"subject": "test email","textMessage": "test body"}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to have a different "from" address other than your own, I have tried adding a different address but get the error :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{"version":2,"httpStatusCode":400,"errorCode":11106,"message":"Invalid 'from' email address. ","details":["path: /mail/messages"],"remediation":"The 'from' email address did not match your email address."}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any link to some documentation on this API will also be very helpful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
    <pubDate>Tue, 08 Aug 2023 13:15:42 GMT</pubDate>
    <dc:creator>Dewald</dc:creator>
    <dc:date>2023-08-08T13:15:42Z</dc:date>
    <item>
      <title>Example for sending email using REST Api</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Example-for-sending-email-using-REST-Api/m-p/888352#M1966</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was hoping someone can give me an example of sending an email with an attachment using a curl command to call the REST Api.&lt;/P&gt;&lt;P&gt;I have been searching without much luck, but have been able to put together the below code from example I found, but it doesn't include an attachment.&lt;BR /&gt;&lt;BR /&gt;curl -s -k -X POST "$SAS_SERVICES_URL/mail/messages" -H "Authorization: Bearer $SAS_CLIENT_TOKEN" -H 'Content-Type: application/vnd.sas.mail+json' -d '{"to": [{"address": "test@test"}],"from":{"address": "user@test"},"subject": "test email","textMessage": "test body"}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to have a different "from" address other than your own, I have tried adding a different address but get the error :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{"version":2,"httpStatusCode":400,"errorCode":11106,"message":"Invalid 'from' email address. ","details":["path: /mail/messages"],"remediation":"The 'from' email address did not match your email address."}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any link to some documentation on this API will also be very helpful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Aug 2023 13:15:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Example-for-sending-email-using-REST-Api/m-p/888352#M1966</guid>
      <dc:creator>Dewald</dc:creator>
      <dc:date>2023-08-08T13:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: Example for sending email using REST Api</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Example-for-sending-email-using-REST-Api/m-p/888375#M1967</link>
      <description>I believe you need to be a SAS Administrator to send from an alternate address.&lt;BR /&gt;&lt;BR /&gt;In the application/vnd.sas.mail+json content type the attachments array is at the same level as the to and from arrays, and the objects contain 3 keys: name, type (the MIME type) and data.</description>
      <pubDate>Tue, 08 Aug 2023 14:20:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Example-for-sending-email-using-REST-Api/m-p/888375#M1967</guid>
      <dc:creator>gwootton</dc:creator>
      <dc:date>2023-08-08T14:20:11Z</dc:date>
    </item>
  </channel>
</rss>

