DATA Step, Macro, Functions and more

Data Step Email with HTML formatted body?

Reply
N/A
Posts: 0

Data Step Email with HTML formatted body?

Hi,
I am trying to send an email from the datastep, I have a sample program that generates the email and sends it. That works great! However, I would like to have the body of the email display in HTML, currently I get the text display (I see the html tags. If I save the text to a file and open that with a browser it displays as I want.) What I want is the email body to display as formatted HTML.

Here is the start/end of the body of the message
 Dear Gerry ,
...





and the code I use including the filename and portionst of the datasetep:

filename mailbox email to="&memail1"
subject ='test email'
type="text/html";
data _null_;
set list end=lastobs;
file mailbox;
if _n_ = 1 then do;

put ''
''
''
'
';
end;

/* Heading using name*/
pname=trim("&mname1")!! ' ,';
put 'Dear ' pName;

...
* write out close of html;

if lastobs then do;
put '
'
''
'';
end;

Run;

Is there a way to send the body of an email from the data step as HTML?
I looked, and there is lots of great info about emailing from SAS, but I could not find a way to format the datastep body as html. There is lots to show as a file attachment, or PROC output, neither of which works for me.
Erik has a great paper at http://www2.sas.com/proceedings/forum2008/038-2008.pdf
but that doesn't help with using the data step to create HTML as the body of the email.
Thanks for any info,
Gerry
Super Contributor
Posts: 291

Re: Data Step Email with HTML formatted body?

Does this help?

filename gwc email ' '
to=("galvwarmerreport@hamilton.ca")
subject="Galvanize Warmer Consumption for &start to &end"
type="text/html";


data _null_;

file gwc;
put "

another SAS® powered auto e-mail report from Quality Systems";
put "
";
put "
Click on the link below to view/print file contents";
put "
";
put "

HREF='\\MOFtp\MainFrameFtp\EsaDown\GalvWarmerTracking.pdf'>
Galvanize Warmer Cons...

";
put "
";
put "
";
put "
Questions, comments or concerns?";
put "
Send reply email to: Quality Systems Reports";
run; This didn't display properly. Let me try again.


Message was edited by: Bill
Ask a Question
Discussion stats
  • 1 reply
  • 136 views
  • 0 likes
  • 2 in conversation