DATA Step, Macro, Functions and more

Send email with text in the body section from sas

Reply
Contributor
Posts: 67

Send email with text in the body section from sas

How to from sas i can send email the generated report to recipient with report content in the body section.

Contributor
Posts: 67

Re: Send email with text in the body section from sas

i got it to send the text in the body section. But email is sending fine. but the text looks as below

 

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta name="Generator" content="SAS Software Version 9.4, see www.sas.com"> <meta http-equiv="Content-type" content="text/html; charset=windows-1252"> <title>SAS Output</title> <style type="text/css">

<!--

.aftercaption

{

  background-color: #E0E0E0;

  border-spacing: 0px;

  color: #000000;

  font-family: Arial, Helvetica, sans-serif;

  font-size: medium;

  font-style: normal;

  font-weight: bold;

  padding-top: 4pt;

}

.batch

Valued Guide
Posts: 559

Re: Send email with text in the body section from sas

try CT in Filename

CT= "text/html" 

 

Thanks,
Suryakiran
Valued Guide
Posts: 559

Re: Send email with text in the body section from sas

Check this code that I use to send a report with text in the email. Report will be in the body. I'm using a custom style since to make my email look good.

Proc template;
Define style Style.Custom;
parent=styles.Default;
style html
   "Common HTML text used in the default style" /
   'expandAll' = "<SPAN onClick=""if(msie4==1)expandAll()"">"
   'posthtml flyover line' = "</SPAN><HR size=3>"
   'prehtml flyover line' = "<SPAN><HR size=3>"
   'prehtml flyover bullet' = %nrstr("<SPAN><b>·</b>")
   'posthtml flyover' = "</SPAN>"
   'prehtml flyover' = "<SPAN>"
   'break' = "<br>"
   'Line' = "<HR size=3>"
   'PageBreakLine' ="";
end;
run;
FILENAME output EMAIL
	SUBJECT= "Test email"
	FROM="abc@abc.com" 
	TO=("123@abc.com")
 	CT= "text/html" /* Required for HTML output */ ;

ODS HTML File=output rs=none STYLE=Style.Custom ;

proc odstext;
   p "Hi, ";
   p "  ";
   p "  ";
   p "Add your text here";
   p "  ";
run;

proc print data=sashelp.class;
run;
proc odstext;
   p "  ";
   p "  ";
   p "  ";
   p "Thanks, ";
   p " Kiran  ";
   p "  ";
run;
ODS _ALL_ CLOSE;
Filename output clear;
Thanks,
Suryakiran
Ask a Question
Discussion stats
  • 3 replies
  • 69 views
  • 0 likes
  • 2 in conversation