BookmarkSubscribeRSS Feed
Ronein
Onyx | Level 15

Hello

I want to send an email from sas .

I want that one sentence (text) be in red color

FILENAME mail EMAIL 
from="Ron.Dave@gmail.com"
TO=("Ron.Dave@gmail.com")
SUBJECT=" UPDATE"
encoding='utf-8'  
CONTENT_TYPE="text/plain" ;
ODS LISTING CLOSE;

 
data _null_;
file mail;
put 'HELLO';
put  style(header)={background=Red color=blue}  "Here is my report";
put ' ';
put ' ';
put ' ';
put 'Dave';
run;


 

2 REPLIES 2
sbxkoenk
SAS Super FREQ

You need an SMTP e-mail host !

How to use Gmail to send a message from a SAS program - The SAS Dummy

 

I think you need 

type='text/html'

instead of plain text !

Use SAS to send an email that embeds a graph in the body of the email - SAS Users

 

Ciao,

Koen

Kathryn_SAS
SAS Employee

You will need code similar to the following:

filename mymail email 
        from="Ron.Dave@gmail.com"
        TO=("Ron.Dave@gmail.com")
        subject="Update" 
        type='text/html';

data _null_;
  file mymail;
  put '<html><body>';
  put '<p>Hello</p>';
  put '<p><font color="blue">Here is my report</font></p>';
  put '</body></html>';
  put '</html>';
run;

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 2 replies
  • 452 views
  • 0 likes
  • 3 in conversation