Hi All,
Recently we have upgraded our SAS env from M6 to M8 . when we try to run below code. It is sending Stange email.
Nothing has changed expect versions. same code works fine in M6 but not in M8.
See below code.
%macro mail();
title;
footnote;
ods listing close;
filename mailit email
to = ("xxx.com")
subject = "Checker Reporting";
ODS ESCAPECHAR='~';
ODS MSOFFICE2K FILE=MAILIT STYLE=SASWEB
OPTIONS(PAGEBREAK="NO");
proc odstext;
p "Please note that XXXXXXXX" / style=[fontsize=10pt
fontfamily=Calibri color=black];
p "" / style=[fontsize=10pt
fontfamily=Calibri color=black];
p "" / style=[fontsize=10pt
fontfamily=Calibri color=black];
;
p "If you have any questions regarding this email reply to:" / style=[fontsize=10pt
fontfamily=Calibri color=black];
p " quote reference : CHECKER.sas " / style=[fontsize=10pt
fontfamily=Calibri color=black];
p "" / style=[fontsize=10pt
fontfamily=Calibri color=black];
p "Thanks and regards" / style=[fontsize=10pt
fontfamily=Calibri color=black];
p "team" / style=[fontsize=10pt
fontfamily=Calibri color=black];
;
run;
ODS _ALL_ CLOSE;
%mend;
%mail;
output email we recive.
<html xmlns:v="urn:schemas-microsoft-com:vml"> <head> <meta name="Generator" content="SAS Software Version 9.4, see https://eur02.safelinks.protection.outlook.comsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=tQbCBFwdLaOFaGF55ZI%2BvCVbC7fbvgFh3KjT7X01hiw%3D&reserved=0"> <meta http-equiv="Content-type" content="text/html; charset=iso-8859-1"> <title>SAS Output</title> <style type="text/css"> <!-- .accessiblecaption { background-color: #FFFFFF; color: #003399; font-family: Arial, Helvetica, sans-serif; font-size: x-small; font-style: normal; font-weight: normal; } .aftercaption { background-color: #FFFFFF; border-spacing: 0px; color: #003399; font-family: Arial, Helvetica, sans-serif; font-size: x-small; font-style: normal; font-weight: bold; } .batch { background-color: #FFFFFF; border: 1px solid #000000; border-collapse: separate; border-spacing: 1px; color: #003399; font-family: 'SAS Monospace', 'Courier New', Courier, monospace; font-size: x-small; font-style: normal; font-weight: normal; padding: 7px; } .beforecaption { background-color: #FFFFFF; border-spacing: 0px; color: #003399;
Thanks,
SS
Try adding the TYPE= option to your FILENAME statement:
filename mailit email
to = ("xxx@xxx.com")
subject = "Checker Reporting" type="text/html" ;
I assume that's just the beginning of the email? So basically the body of the email is showing you the HTML code instead of rendering the HTML?
Since you have both M6 and M8 available, you might try writing the MSOFFICE2K output to a file, and then comparing the files you get from M6 and M8 to look for differences. I'd be surprised if SAS intentionally changed the MSOFFICE2K template.
Once you have the differences, you could send the sample code and output files to tech support.
Try adding the TYPE= option to your FILENAME statement:
filename mailit email
to = ("xxx@xxx.com")
subject = "Checker Reporting" type="text/html" ;
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.
Ready to level-up your skills? Choose your own adventure.