BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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
1 REPLY 1
Bill
Quartz | Level 8
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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 916 views
  • 0 likes
  • 2 in conversation