BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
sathya66
Barite | Level 11

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

1 ACCEPTED SOLUTION

Accepted Solutions
Kathryn_SAS
SAS Employee

Try adding the TYPE= option to your FILENAME statement:

filename mailit email
	to = ("xxx@xxx.com")
	subject = "Checker Reporting" type="text/html" ;

View solution in original post

3 REPLIES 3
Quentin
Super User

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.

 

 

sathya66
Barite | Level 11
Sorry M6 is decommissioned.
yes, that is the beginning of the email
Kathryn_SAS
SAS Employee

Try adding the TYPE= option to your FILENAME statement:

filename mailit email
	to = ("xxx@xxx.com")
	subject = "Checker Reporting" type="text/html" ;

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

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!

Register Now

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
  • 3 replies
  • 333 views
  • 1 like
  • 3 in conversation