BookmarkSubscribeRSS Feed
Ronein
Meteorite | Level 14

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 Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 294 views
  • 0 likes
  • 3 in conversation