BookmarkSubscribeRSS Feed
meb
Calcite | Level 5 meb
Calcite | Level 5

Need to email a SAS graph such that the body of the email contains the graph.  Using SAS 9.4 on Unix server.  Any suggestions?

5 REPLIES 5
Shmuel
Garnet | Level 18

Why not attach the graph file (as jpg or other format) to the email 

and have a notice to the attached file in the body ?

meb
Calcite | Level 5 meb
Calcite | Level 5

I am able to do that, however the requirement from the business partner is for the content to display in the body of the email.

Rick_SAS
SAS Super FREQ

This topic gets discussed a few times a year. Did you look at the suggestions in the thread "Embed an image in Outlook".  It suggests using HTML. Also see "Embedded image in HTML email"  for suggestions.   

MartinBresser
Calcite | Level 5

You can embed an image using the inlined= option when you attach the image to the email.

 

This gives the image a name you can use in HTML.

 

 

See this example from http://support.sas.com/documentation/cdl/en/lestmtsref/68024/HTML/default/viewer.htm#n0ig2krarrz6vtn...


options emailsys=smtp;

filename myemail email
to="Jim@acme.com"
from="Wiley <wcoyote@acme.com>"
sender="Wiley <wcoyote@sas.com>"
attach=('C:\Public\Pictures\Sample Pictures\sasLogo.gif' NAME="sasLogo" INLINED="logo"
'C:\temp\reportToEmail.html' NAME='myreport')
subject="Embedded Image Example"
content_type="text/html";

data _null_;
file myemail;
put 'Dear customer,<br><br>';
put 'This is an example email with content type text/html, an attached report ';
put 'and an embedded image.<br><br>';
put 'Sincerely,<br><br>';
put 'Wiley Coyote<br>';
put 'Developer<br>';
put 'SAS Research & Development<br>';
put '1234 Any Street<br> ';
put 'Sampletown';
put 'NC 45678<br><br><br>';
put '<IMG src="cid:logo" height="40" width="160">';
run;

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 4636 views
  • 0 likes
  • 5 in conversation