<?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: Embed an image in Outlook email sent using SAS in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Embed-an-image-in-Outlook-email-sent-using-SAS/m-p/977792#M25708</link>
    <description>&lt;DIV class="heading cf"&gt;
&lt;H1 class="post-title item fn"&gt;Use SAS to send an email that embeds a graph in the body of the email&lt;/H1&gt;
&lt;/DIV&gt;
&lt;DIV class="post-meta cf"&gt;&lt;SPAN class="posted-by"&gt;By&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="reviewer"&gt;&lt;A title="Posts by Martin Mincey" href="https://blogs.sas.com/content/author/martinmincey/" rel="author" target="_blank"&gt;Martin Mincey&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;on&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://blogs.sas.com/content/sgf/" target="_blank"&gt;SAS Users&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="posted-on"&gt;&lt;SPAN class="dtreviewed"&gt;&lt;TIME class="value-title" title="2017-04-21" datetime="2017-04-21T08:57:22-04:00"&gt;April 21, 2017&lt;/TIME&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="post-meta cf"&gt;&lt;SPAN class="posted-on"&gt;&lt;A href="https://blogs.sas.com/content/sgf/2017/04/21/use-sas-send-email-embeds-graph-body-email/" target="_blank"&gt;https://blogs.sas.com/content/sgf/2017/04/21/use-sas-send-email-embeds-graph-body-email/&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;</description>
    <pubDate>Fri, 24 Oct 2025 20:29:58 GMT</pubDate>
    <dc:creator>ajs_rdg</dc:creator>
    <dc:date>2025-10-24T20:29:58Z</dc:date>
    <item>
      <title>Embed an image in Outlook email sent using SAS</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Embed-an-image-in-Outlook-email-sent-using-SAS/m-p/159267#M5974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Is there a possible way,&amp;nbsp; using SAS we could send out an outlook email with a screenshot or picture embedded within the email? It is not an attachment. Basically as soon as the email recipient opens the email he/she should be able to see the screenshot/picture.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know the part of sending out the emails via SAS but I am not sure if we can embed a picture along with the email content?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please share your tips and knowledge on this topic?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Jun 2014 01:01:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Embed-an-image-in-Outlook-email-sent-using-SAS/m-p/159267#M5974</guid>
      <dc:creator>path2success</dc:creator>
      <dc:date>2014-06-28T01:01:54Z</dc:date>
    </item>
    <item>
      <title>Re: Embed an image in Outlook email sent using SAS</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Embed-an-image-in-Outlook-email-sent-using-SAS/m-p/159268#M5975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This isn't quite what you were looking for, but Robert Allison has a nice post describing using html5 to embed an image in an html file. But his suggestion for emailing it is to attach the html file, rather than have it actually be the body of the messsage.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://blogs.sas.com/content/sastraining/2013/11/06/sas-9-4-has-a-new-way-to-send-interactive-graphs-in-email/"&gt;http://blogs.sas.com/content/sastraining/2013/11/06/sas-9-4-has-a-new-way-to-send-interactive-graphs-in-email/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the problem is that while most modern browsers support html5 (or at least mostly support it), many email clients (e.g. Outlook) may not. I wonder if it would be worth trying to send the email in RTF format instead of HTML?&amp;nbsp; RTF can embed images.... I've never tried that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--Q.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Jun 2014 01:40:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Embed-an-image-in-Outlook-email-sent-using-SAS/m-p/159268#M5975</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2014-06-28T01:40:28Z</dc:date>
    </item>
    <item>
      <title>Re: Embed an image in Outlook email sent using SAS</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Embed-an-image-in-Outlook-email-sent-using-SAS/m-p/159269#M5976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i hope solution will still be relevant to you, if not i think it might be usefull for anyone landing on this page &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm working on v9.2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN&gt;FILENAME myemail EMAIL from="&lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:your@email.com"&gt;your@email.com&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;encoding='wlatin2'&amp;nbsp; /* i use it for east european characters */&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN&gt;to = "&lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:recepient@email.com"&gt;recepient@email.com&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;subject = "solution to display image in email body"&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;type = "text/html"&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;attach = "fullPath\imagename.png"&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;ods listing close; /* close default ods */&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;ods html body=myemail options(pagebreak="no") style=myHTML rs=none; /* start ods to html with options, rs=none forces &lt;SPAN style="color: #000000; font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 13px; background-color: #ffffff;"&gt;ODS to perform record based output */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;data _null_; &lt;SPAN style="font-size: 13.3333330154419px;"&gt; /* embed attached image */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;ods html text = '&amp;lt;img src = "imagename.png""&amp;gt;&amp;lt;/img&amp;gt;';&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;run;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;ods _all_close; /* close all (html) ods */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached file should appear in body content, at least it does in outlook 2007 and 2010.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Apr 2015 07:50:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Embed-an-image-in-Outlook-email-sent-using-SAS/m-p/159269#M5976</guid>
      <dc:creator>David86</dc:creator>
      <dc:date>2015-04-03T07:50:48Z</dc:date>
    </item>
    <item>
      <title>Re: Embed an image in Outlook email sent using SAS</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Embed-an-image-in-Outlook-email-sent-using-SAS/m-p/246228#M8922</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks David,&lt;/P&gt;
&lt;P&gt;I'll just add that the image file must not have any space in its name (cost me a good hour to figure out what was wrong). &amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'll add that escapechars and html tag can both be used, like in this example :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;options emailsys = SMTP;

options emailhost = my.smtp.server;

filename myemail EMAIL
    to=("TO_ADDRESS@domain.com")
 from="FROM NAME &amp;lt;from.name@domain.com&amp;gt;"
 sender="FROM NAME &amp;lt;from.name@domain.com&amp;gt;"
 /*importance="HIGH"*/
 subject = "Subject"
 type = "text/html"
 attach =(
 "fullpath\header.png"
 );


ods listing close;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&lt;BR /&gt;ods html 
	body=myemail 
	options(pagebreak="no") 
	style=sasweb rs=none; 
		/* start ods to html with options, rs=none forces ODS to perform record based output */

title;
ods escapechar="^";

ods html text= '&amp;lt;img src="./header.png" alt="header"&amp;gt;';
ods html text= "&amp;lt;p&amp;gt;Blah blah blah,&amp;lt;/p&amp;gt;";
ods html text= "&amp;lt;p&amp;gt;Blah blah blah blah  ^S={font_style=italic}BLAH^S={}..&amp;lt;/p&amp;gt;";
ods html text= "&amp;lt;p&amp;gt;blah  &amp;lt;a href='www.blah.com' target='_blank'&amp;gt;www.blah.com&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;";

ods html text= "&amp;lt;p&amp;gt;^S={font_weight=bold}First Lastname^S={}&amp;lt;br&amp;gt;
						Division&amp;lt;br&amp;gt;
						Company inc.&amp;lt;/p&amp;gt;";
ods _all_ close;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2016 21:19:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Embed-an-image-in-Outlook-email-sent-using-SAS/m-p/246228#M8922</guid>
      <dc:creator>morglum</dc:creator>
      <dc:date>2016-01-26T21:19:28Z</dc:date>
    </item>
    <item>
      <title>Re: Embed an image in Outlook email sent using SAS</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Embed-an-image-in-Outlook-email-sent-using-SAS/m-p/468214#M16115</link>
      <description>&lt;P&gt;Can't be done using only SAS unfortunately - SAS doesn't support embedding images into an email in a manner that outlook will display.&amp;nbsp; Not entirely SAS's fault &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;'Rich' emails were implemented haphazardly in general.&amp;nbsp; Outlook still uses the HTML engine from word to render/display them which gives you an idea of the kind of uphill battle you're fighting.&amp;nbsp; Most CSS is not recognized, and the CSS it does recognize is incredibly finicky.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also see:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/16242489/send-a-base64-image-in-html-email" target="_blank"&gt;https://stackoverflow.com/questions/16242489/send-a-base64-image-in-html-email&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Despite all of these issues, I've had success in the past using "blat" (a 3rd party emailing tool) to embed images into emails in a manner that mixes multiple images (charts) and HTML tables together and presents them in a consistent manner across mobile email readers + outlook clients.&amp;nbsp; In order to do this I basically created HTML files that referred to the image in standard &amp;lt;IMAGE&amp;gt; tags, then used the -embed command line option in blat to attach the images (which are sent as their own MIME parts I guess).&amp;nbsp; Outlook was then able to render them successfully.&amp;nbsp; It's a serious investment in time to get working, much easier to just attach as a PDF or image unfortunately.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jun 2018 23:08:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Embed-an-image-in-Outlook-email-sent-using-SAS/m-p/468214#M16115</guid>
      <dc:creator>RobP</dc:creator>
      <dc:date>2018-06-06T23:08:20Z</dc:date>
    </item>
    <item>
      <title>Re: Embed an image in Outlook email sent using SAS</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Embed-an-image-in-Outlook-email-sent-using-SAS/m-p/977792#M25708</link>
      <description>&lt;DIV class="heading cf"&gt;
&lt;H1 class="post-title item fn"&gt;Use SAS to send an email that embeds a graph in the body of the email&lt;/H1&gt;
&lt;/DIV&gt;
&lt;DIV class="post-meta cf"&gt;&lt;SPAN class="posted-by"&gt;By&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="reviewer"&gt;&lt;A title="Posts by Martin Mincey" href="https://blogs.sas.com/content/author/martinmincey/" rel="author" target="_blank"&gt;Martin Mincey&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;on&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://blogs.sas.com/content/sgf/" target="_blank"&gt;SAS Users&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="posted-on"&gt;&lt;SPAN class="dtreviewed"&gt;&lt;TIME class="value-title" title="2017-04-21" datetime="2017-04-21T08:57:22-04:00"&gt;April 21, 2017&lt;/TIME&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="post-meta cf"&gt;&lt;SPAN class="posted-on"&gt;&lt;A href="https://blogs.sas.com/content/sgf/2017/04/21/use-sas-send-email-embeds-graph-body-email/" target="_blank"&gt;https://blogs.sas.com/content/sgf/2017/04/21/use-sas-send-email-embeds-graph-body-email/&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 24 Oct 2025 20:29:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Embed-an-image-in-Outlook-email-sent-using-SAS/m-p/977792#M25708</guid>
      <dc:creator>ajs_rdg</dc:creator>
      <dc:date>2025-10-24T20:29:58Z</dc:date>
    </item>
  </channel>
</rss>

