<?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 sending html output via email with pictures in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/sending-html-output-via-email-with-pictures/m-p/126812#M4938</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to distribute an email with an attached HTML file to myself with a set of data attached, I can create the file I want to send (displays correctly in SAS and through other applications is i open directly) and I can attach the file and it sends.&amp;nbsp; However, when I open the attachment I get the red 'X' indicating it can't find the file.&amp;nbsp; The source code doesn't have a path to the .png but is pointing at the correct graphic name.&amp;nbsp; I'm using SAS 9.3 on a 64bit Windows server (2008).&amp;nbsp; I've found a similar problem someone posted on a UNIX server but their solution was the uuencode unix command option which I don't believe there is an equivalent to in SAS.&amp;nbsp; Code is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* adapted from Rob Allison's Stock Table */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;goptions ftitle="albany amt" ftext="albany amt" ctext=gray22 htitle=14pt htext=8pt;&lt;/P&gt;&lt;P&gt;ODS LISTING CLOSE;&lt;/P&gt;&lt;P&gt;ODS HTML path=odsout body="&amp;amp;name..htm" gpath=odsout&amp;nbsp; (title="SAS/Graph Portfolio Table") options(pagebreak='no') style=minimal;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;symbol1 value=none interpol=join color=cx00cc00; /* green line */&lt;BR /&gt;symbol2 value=dot h=5pt interpol=none color=cx42c3ff; /* bright blue - high value */&lt;BR /&gt;symbol3 value=dot h=5pt interpol=none color=cxf755b5; /* red/pink - low value */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;axis1 style=0 label=none major=none minor=none value=none offset=(0,0);&lt;BR /&gt;axis2 style=0 label=none major=none minor=none value=none offset=(45,40);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;title1 "***********";&lt;BR /&gt;title2 height=20pt " ";&lt;/P&gt;&lt;P&gt;footnote1 j=r c=gray "Note: Each sparkline is independently auto-scaled";&lt;/P&gt;&lt;P&gt;proc gplot data=plotdata anno=anno_table&lt;BR /&gt; plot norm_A*mindate=1 high_A*mindate=2 low_A*mindate=3 / overlay skipmiss&lt;BR /&gt; autovref cvref=graydd&lt;BR /&gt; vaxis=axis1&lt;BR /&gt; haxis=axis2&lt;BR /&gt; noframe&lt;BR /&gt; anno=anno_lines&lt;BR /&gt; des='' name="&amp;amp;name";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;quit;&lt;BR /&gt;ods html close ;&lt;BR /&gt;ods listing ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;options emailsys=smtp emailhost="my.company.com" emailport=25;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename mymail email &lt;BR /&gt;to="&lt;A href="mailto:me@mycompany.com"&gt;me@mycompany.com&lt;/A&gt;" &lt;BR /&gt;from="Me&amp;lt;&lt;A href="mailto:me@mycompany.com"&gt;me@mycompany.com&lt;/A&gt;&amp;gt;"&lt;BR /&gt;replyto="&lt;A href="mailto:me@mycompany.com"&gt;me@mycompany.com&lt;/A&gt;"&lt;BR /&gt;subject="Tracker"&lt;BR /&gt;attach="&lt;A href="https://communities.sas.com/"&gt;\\drivelocation\table.htm&lt;/A&gt;"; &lt;SPAN style="color: #ff0000;"&gt; /* this is the hardcode name of &amp;amp;name above*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data _null_;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; file mymail;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put 'here is the latest report';&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put 'file:\\drivelocation\table.htm';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;/* another small issue is that the drive location has a space and therefore doesn't resolve in the email with a link correctly - anyone have a quick workaround? */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;run; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Jan 2013 11:01:33 GMT</pubDate>
    <dc:creator>to_the_point</dc:creator>
    <dc:date>2013-01-16T11:01:33Z</dc:date>
    <item>
      <title>sending html output via email with pictures</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sending-html-output-via-email-with-pictures/m-p/126812#M4938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to distribute an email with an attached HTML file to myself with a set of data attached, I can create the file I want to send (displays correctly in SAS and through other applications is i open directly) and I can attach the file and it sends.&amp;nbsp; However, when I open the attachment I get the red 'X' indicating it can't find the file.&amp;nbsp; The source code doesn't have a path to the .png but is pointing at the correct graphic name.&amp;nbsp; I'm using SAS 9.3 on a 64bit Windows server (2008).&amp;nbsp; I've found a similar problem someone posted on a UNIX server but their solution was the uuencode unix command option which I don't believe there is an equivalent to in SAS.&amp;nbsp; Code is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* adapted from Rob Allison's Stock Table */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;goptions ftitle="albany amt" ftext="albany amt" ctext=gray22 htitle=14pt htext=8pt;&lt;/P&gt;&lt;P&gt;ODS LISTING CLOSE;&lt;/P&gt;&lt;P&gt;ODS HTML path=odsout body="&amp;amp;name..htm" gpath=odsout&amp;nbsp; (title="SAS/Graph Portfolio Table") options(pagebreak='no') style=minimal;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;symbol1 value=none interpol=join color=cx00cc00; /* green line */&lt;BR /&gt;symbol2 value=dot h=5pt interpol=none color=cx42c3ff; /* bright blue - high value */&lt;BR /&gt;symbol3 value=dot h=5pt interpol=none color=cxf755b5; /* red/pink - low value */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;axis1 style=0 label=none major=none minor=none value=none offset=(0,0);&lt;BR /&gt;axis2 style=0 label=none major=none minor=none value=none offset=(45,40);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;title1 "***********";&lt;BR /&gt;title2 height=20pt " ";&lt;/P&gt;&lt;P&gt;footnote1 j=r c=gray "Note: Each sparkline is independently auto-scaled";&lt;/P&gt;&lt;P&gt;proc gplot data=plotdata anno=anno_table&lt;BR /&gt; plot norm_A*mindate=1 high_A*mindate=2 low_A*mindate=3 / overlay skipmiss&lt;BR /&gt; autovref cvref=graydd&lt;BR /&gt; vaxis=axis1&lt;BR /&gt; haxis=axis2&lt;BR /&gt; noframe&lt;BR /&gt; anno=anno_lines&lt;BR /&gt; des='' name="&amp;amp;name";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;quit;&lt;BR /&gt;ods html close ;&lt;BR /&gt;ods listing ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;options emailsys=smtp emailhost="my.company.com" emailport=25;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename mymail email &lt;BR /&gt;to="&lt;A href="mailto:me@mycompany.com"&gt;me@mycompany.com&lt;/A&gt;" &lt;BR /&gt;from="Me&amp;lt;&lt;A href="mailto:me@mycompany.com"&gt;me@mycompany.com&lt;/A&gt;&amp;gt;"&lt;BR /&gt;replyto="&lt;A href="mailto:me@mycompany.com"&gt;me@mycompany.com&lt;/A&gt;"&lt;BR /&gt;subject="Tracker"&lt;BR /&gt;attach="&lt;A href="https://communities.sas.com/"&gt;\\drivelocation\table.htm&lt;/A&gt;"; &lt;SPAN style="color: #ff0000;"&gt; /* this is the hardcode name of &amp;amp;name above*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data _null_;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; file mymail;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put 'here is the latest report';&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put 'file:\\drivelocation\table.htm';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;/* another small issue is that the drive location has a space and therefore doesn't resolve in the email with a link correctly - anyone have a quick workaround? */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;run; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2013 11:01:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sending-html-output-via-email-with-pictures/m-p/126812#M4938</guid>
      <dc:creator>to_the_point</dc:creator>
      <dc:date>2013-01-16T11:01:33Z</dc:date>
    </item>
    <item>
      <title>Re: sending html output via email with pictures</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sending-html-output-via-email-with-pictures/m-p/126813#M4939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Because of the disconnect between HTML files and images they reference, e-mailing HTML can be very problematic. A better solution might be to use PDF or RTF files instead because the graphics are directly embedded in the file. To try this out, change your code to be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods pdf file="\\drivelocation\table.pdf";&lt;/P&gt;&lt;P&gt;/* the plot */&lt;/P&gt;&lt;P&gt;ods pdf close;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Change the "attach=" to reference "\\drivelocation\table.pdf".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2013 12:54:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sending-html-output-via-email-with-pictures/m-p/126813#M4939</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2013-01-16T12:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: sending html output via email with pictures</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sending-html-output-via-email-with-pictures/m-p/126814#M4940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you're just emailing a graph (rather than, say, a graph &lt;STRONG&gt;and&lt;/STRONG&gt; a proc print table), you could maybe just email the .png file.&amp;nbsp; You wouldn't be able to use any html mouse-over text or href drilldowns on the graph, but you might not be using those anyway(?)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2013 13:11:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sending-html-output-via-email-with-pictures/m-p/126814#M4940</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2013-01-16T13:11:35Z</dc:date>
    </item>
    <item>
      <title>Re: sending html output via email with pictures</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sending-html-output-via-email-with-pictures/m-p/126815#M4941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, this has worked as a PDF but I had tried the RTF approach earlier without success.&amp;nbsp; The PDF approach stretches the graph to the full page, but as I have more data to add it may well work better!&amp;nbsp; Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2013 13:34:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sending-html-output-via-email-with-pictures/m-p/126815#M4941</guid>
      <dc:creator>to_the_point</dc:creator>
      <dc:date>2013-01-16T13:34:58Z</dc:date>
    </item>
    <item>
      <title>Re: sending html output via email with pictures</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sending-html-output-via-email-with-pictures/m-p/126816#M4942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I've been trying the .png approach but have been having trouble keeping the name the same, so although I can make it work once I've not been able to automate - I've tried deleting existing .png's with the X command but I can't get it to work.&amp;nbsp; Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2013 13:37:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sending-html-output-via-email-with-pictures/m-p/126816#M4942</guid>
      <dc:creator>to_the_point</dc:creator>
      <dc:date>2013-01-16T13:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: sending html output via email with pictures</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sending-html-output-via-email-with-pictures/m-p/126817#M4943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the name has already been used once during a SAS session, then SAS auto-increments a number onto the end of the name.&amp;nbsp; To re-use the exact same name, you have to delete the grseg from the previous time.&amp;nbsp; Tech support provides some code to help with this in the following help page...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/kb/38/183.html" style="font-size: 10pt; line-height: 1.5em;" title="http://support.sas.com/kb/38/183.html"&gt;38183 - "Error: Memname GSEG is unknown" might occur when running PROC GREPLAY&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2013 13:44:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sending-html-output-via-email-with-pictures/m-p/126817#M4943</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2013-01-16T13:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: sending html output via email with pictures</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sending-html-output-via-email-with-pictures/m-p/126818#M4944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks - very useful - one last question - how do I deal with putting drive names as a link when the drive names have a space in them?&amp;nbsp; I vaguely remember using tilda's "~" but I'm not sure?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2013 15:17:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sending-html-output-via-email-with-pictures/m-p/126818#M4944</guid>
      <dc:creator>to_the_point</dc:creator>
      <dc:date>2013-01-16T15:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: sending html output via email with pictures</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sending-html-output-via-email-with-pictures/m-p/126819#M4945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The drive name (such as "c:"), the filename, or both?&amp;nbsp;&amp;nbsp; And where are you using it? (in the body=, or the put statement, or other?)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you post up the exact name, and where you're wanting to use it, somebody might be able to post up the exact answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the meantime, the following page I found in a Web search has some info about shortening names:&lt;/P&gt;&lt;P&gt;&lt;A href="http://en.wikipedia.org/wiki/8.3_filename" title="http://en.wikipedia.org/wiki/8.3_filename"&gt;8.3 filename - Wikipedia, the free encyclopedia&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2013 15:40:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sending-html-output-via-email-with-pictures/m-p/126819#M4945</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2013-01-16T15:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: sending html output via email with pictures</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/sending-html-output-via-email-with-pictures/m-p/126820#M4946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use goptions XPIXELS/YPIXELS or HSIZE/VSIZE to control the size of the graph in the PDF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2013 15:50:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/sending-html-output-via-email-with-pictures/m-p/126820#M4946</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2013-01-16T15:50:18Z</dc:date>
    </item>
  </channel>
</rss>

