BookmarkSubscribeRSS Feed
SanthSG
Fluorite | Level 6

Hi Could you all please help me in inserting HTML Text with font options in SAS Email. I tried the below code but without proc report in body the output is blank.

 

 

 

filename mymail email from="santh@urbanpro.com"

to=("santh@urbanpro.com")

subject="Territory Sales"
content_type="Text/HTML"
attach = ("/sasdata/sas_codes/NewSales/SalesValid.xls" Content_type="application/excel");
ods _all_ close;
ODS ESCAPECHAR='^';
ods html body=mymail style=minimal;

title j=left font = verdana height=10pt color=black
title "Good Morning, ^{newline 2}

Attached is the Aug 2016 Sales Report. ^{newline 2}


Thanks and Regards, ^{newline 2}

^{style [Font_weight=bold FONT=(verdana,8Pt) color=Navy ] Santh S} ^{newline 1}
^{style [Font_weight=bold FONT=(verdana,8Pt) color=Navy ] Business Analyst} ^{newline 1}
^{style [ FONT=(verdana,8Pt) color=black ] GR Team} ^{newline 1}
^{style [Font_weight=bold FONT=(verdana,8Pt) color=Navy ] Client Analytics } ^{newline 1}
^{style [Font_weight=bold FONT=(verdana,8Pt) color=Navy ] UnrbaPro} ^{newline 1}
^{style [ FONT=(verdana,8Pt) color=black ] UBSC, Dekhi 400019, INDIA} ^{newline 2}

^{style [ Font_weight=bold FONT=(verdana,8Pt) color=black ] TEL }
^{style [ FONT=(verdana,8Pt) color=black ] + 91 40 4090 1000} ^{newline 1}
^{style [ Font_weight=bold FONT=(verdana,8Pt) color=black ] INTERNAL }

^{style [ FONT=(verdana,8Pt) color=black ] santh@urbanpro.com} ^{newline 5}"
;


proc report data=prod_list;
where type='XSell';
column (odr );
quit;

ods html close;
ods _all_ close;

 

 

I need the only text part with formating but dont want to include any proc report in the mail body.

I appreciate any help on this, Thanks in advance.

6 REPLIES 6
ballardw
Super User

Can you post the log of an attempt with that code. From what you posted I expect to see a number of error messages.

SanthSG
Fluorite | Level 6

Than you for the reply Ballardw, 

 

infact there are no errors in log, but the body part is missing when I remove the Proc report code, else the output is fine as I required. attached is the screen shot which I required. Thanks in advance

 

 


SAS Email.JPG
ballardw
Super User

Titles don't actually get sent to output unless there is something to "attach" the title to. Without the proc report there is not need for a "title" so that text doesn't get sent.

 

I don't use SAS for emails so I can't suggest a specific work around.

SanthSG
Fluorite | Level 6

Thank you Ballardw,

 

will wait for any help in resolving my problem 🙂

Cynthia_sas
Diamond | Level 26
Hi, you might want to open a track with Tech Support. BallardW is correct, without the PROC REPORT code, there is nothing that needs a title. Unless you were going to rewrite this using a DATA step, I can't think of anything that will work.

I don't quite understand what the PROC REPORT code is supposed to be doing, anyway.

cynthia
SanthSG
Fluorite | Level 6

Thank you Cynthia,

 

Yes, I tried with Datastep and now it is working. Thank you all for your prompt response.

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