BookmarkSubscribeRSS Feed
elwayfan446
Barite | Level 11

Ok, I am so much closer but not quite where I want to be just yet.  Hopefully you guys can see what I am missing.  When I run @Manu_SAS's code It does imbed the data into the email but it loses the original formatting.

 

options 
 emailsys=smtp emailhost= "smtp.host.com";
 
filename myemail EMAIL
  from="myemail@somewhere.com"
  to="anotheremail@somewhere.com" 
  subject="Email Test"
  content_type="text/html";

data _null_;
file myemail;
infile"C:\Users\me\Documents\myimage.html";
input;
put _infile_;
run;

filename myemail clear;

This is how it appears in the email body:

Capture.PNG

Here is what the actual file looks like:

 

Capture2.PNG

 

To try and keep the formatting I tried some different code I found but when the email is sent, a box shows up as if it is a missing image.

 

options 
 emailsys=smtp emailhost= "smtp.host.com";
 
filename myemail EMAIL
  from="myemail@somewhere.com"
  to="anotheremail@somewhere.com" 
  subject="Email Test"
  content_type="text/html";

ods listing close;
ods html body=myemail options(pagebreak="no") style=HTMLBlue rs=none;
data _null_;
ods html text='<img src="C:\Users\me\Documents\myimage.html"></img>';
run;
ods _all_ close;

filename myemail clear;

Capture3.PNG

ChrisHemedinger
Community Manager

Sometimes, the e-mail client can be picky about how it renders HTML in an e-mail message, especially with HTML that relies on CSS for appearance formatting.  I have a process that sends e-mail daily to report on our SAS blogs.  Here's what it looks like in my inbox:

 

email.png

 

If I click on the bar to "view it in a web browser", I see:

 

email2.png

 

If I use our webmail access to my inbox (instead of my local Microsoft Outlook), I see the better-formatted version there.

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
elwayfan446
Barite | Level 11

I see.  I guess that could be the case.

 

Any reason why the first block of code embeds it and the second just leaves the "x" like it is missing an image?

elwayfan446
Barite | Level 11

And I guess it could have something to do with us using lotus notes instead of outlook too.

ChrisHemedinger
Community Manager

That second example (with the <img> tag) doesn't make sense to me.  That creates an image reference that points to an html file (odd thing to do), and the html content isn't embedded into your e-mail at all so it's doomed to not resolve for any recipient.

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
elwayfan446
Barite | Level 11

Ok, I see.  I found it somewhere in a google search I stumbled upon.  I have sense left the page.  So the way that @Manu_SAS has described it is the proper and only way then?

 

Looks like I might be stuck with what Lotus Notes is giving me in the first example.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 20 replies
  • 3956 views
  • 2 likes
  • 4 in conversation