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;

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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