I am not able to apply my CSS styles to an email which I am sending it as a html format. If I save the ODS output to a local file, I am able to apply my CSS styles.
Could someone help me on how to pass the CSS styles in an email step?
Here is the code I used:
FILENAME SETMAIL EMAIL TO=("[email protected]")
SUBJECT = "This is a test email with applied CSS HTML styles to email "
TYPE="text/html"
CONTENT_TYPE='text/html' ;
ODS HTML BODY=setmail
CSSSTYLE="D:\\myStyles_EMAIL.css";
TITLE "Be focused !! ";
PROC PRINT DATA=DODEV.RECENT_HIGH_VOL_ORDERS noobs label;
RUN;
ODS HTML CLOSE;
ODS LISTING;
Thanks in advance.
Try using
ODS HTML3
. This embeds the style information directly into the HTML elements so that no CSS is used to render (all the style information is stated repeatedly and explicitly within each HTML tag).This ODS destination is great for backwards compatibility. And seeing as the HTML rendering engine used by Outlook is actually the MS Word Engine, a lot of backwards compatability is required.
Here's the ODS HTML3 doc link: http://support.sas.com/documentation/cdl/en/odsug/61723/HTML/default/viewer.htm#a002596390.ht
Not all HTML formatting is supported by a lot of email clients though. Here's some useful links to give you a good background of what can and can't be done, and what is and isn't supported:
http://24ways.org/2009/rock-solid-html-emails
http://www.emailology.org
http://www.campaignmonitor.com/css/
HTML email align text