skip to Main Content

SAS Programming – Imbed an Image in SAS Email

This is a short article that focuses on the method of how to send an embedded image in a SAS email.

The ODS HTML5 destination can include images in the HTML body. When using this for email you should use JPEG or PNG images. (Scalable vector graphics or SVG is supported by HTML, but not by all email clients.)

An embedded image is considered a special type of attachment within the body of the email message.  As a result, the image data is included in the message body and rendered inline by the email client  for example, Microsoft Outlook, Yahoo, or Gmail. 

 The Mechanics

ods graphics / imagefmt=png height=200 width=200;

filename outbox EMAIL

 to=”rshexxxxx@yahoo.com”

 from=”noreply@alertbox.com”

 subject=”Relationship b/w Hits & Runs”

 ct=”text/html”;

ods html5 (id=mail) file=outbox style=pearlj

 options(bitmap_mode=”inline”) gtitle;

 title “Baseball Hits & Runs”;

proc sgplot data=sashelp.baseball;

  scatter x=nHits y=nRuns;  

run;

ods html5 (id=mail) close;

Back To Top