| Valid in: | Anywhere |
| Category: | Data Access |
You can use any of the following e-mail options in the FILENAME statement to specify attributes for the electronic message. You can also specify these options in the FILE statement. E-mail options that you specify in the FILE statement override any corresponding e-mail options that you specified in the FILENAME statement.
attach="/u/userid/opinion.txt"
attach=('C:\Status\June2001.txt' 'C:\Status\July2001.txt')
attach="user.misc.pds(member)"home.html is
sent with a content type of text/html.
home.html being
received as index.htm.attach=("home.html" name="index" ext="htm")home.html being
received as index.html. attach=("home.html" name="index")bcc field
will receive a copy of the e-mail. The BCC field does not appear in
the e-mail header, so that these e-mail addresses cannot be viewed
by other recipients.
bcc="joe@site.com"
bcc=("joe@site.com" "jane@home.net")
bcc="Joe Smith <joe@site.com>"cc='joe@site.com'
cc=("joe@site.com" "jane@home.net")
cc="Joe Smith <joe@site.com>"from='martin@home.com' from="Brad Martin <martin@home.com>"
filename inventory email 'name@mycompany.com' importance='high'; filename inventory email 'name@mycompany.com' importance='hoch';
replyto='hiroshi@home.com'
replyto=('hiroshi@home.com' 'akiko@site.com')
replyto="Hiroshi Mori <mori@site.com>"subject=Sales subject="June Sales Report"
to='joe@site.com'
to=("joe@site.com" "jane@home.net")
to="Joe Smith <joe@site.com>"The directives that you can specify in a PUT statement to change the attributes of a message are as follows:
put '!em_attach! /u/userid/opinion.txt';
put '!em_attach! ("C:\Status\June2001.txt" "C:\Status\July2001.txt")';
put '!em_attach! user.misc.pds(member)';home.html is
sent with a content type of text/html.
home.html being
received as index.htm.put '!em_attach! ("home.html" name="index" ext="htm")';home.html being
received as index.html. put '!em_attach! ("home.html" name="index")';bcc field
will receive a copy of the e-mail. The BCC field does not appear in
the e-mail header, so that these e-mail addresses cannot be viewed
by other recipients.
put '!em_bcc! joe@site.com';
put '!em_bcc! ("joe@site.com" "jane@home.net")';
put '!em_bcc! Joe Smith <joe@site.com>';put '!em_cc! joe@site.com';
put '!em_cc! ("joe@site.com" "jane@home.com")';
put '!em_cc! Joe Smith <joe@site.com>';put '!em_expires! 15 Aug 2010 08:00'; put '!em_expires! 28 Feb 2011 23:00';
put '!em_from! martin@home.com'; put '!em_from! Brad Martin <martin@home.com>';
put '!em_importance! high'; put '!em_importance! haut';
put '!em_replyto! hiroshi@home.com';
put '!em_replyto! ("hiroshi@home.com" "akiko@site.com")';
put '!em_replyto! Hiroshi Mori <mori@site.com>';put '!em_subject! Sales'; put '!em_subject! "June Sales Report"';
put '!em_to! joe@site.com';
put '!em_to! ("joe@site.com" "jane@home.net")';
put '!em_to! Joe Smith <joe@site.com>';filename mymail email 'martin@site.com' subject='Sending Email'; data _null_; file mymail; put 'Hi'; put 'This message is sent from SAS...'; run;
filename mymail email "JBrown@site.com" subject="My SAS Configuration File" attach="/u/sas/sasv8.cfg"; data _null_; file mymail; put 'Jim,'; put 'This is my SAS configuration file.'; put 'I think you might like the'; put 'new options I added.'; run;
filename outbox email "ron@acme.com";
data _null_;
file outbox
to=("ron@acme.com" "humberto@acme.com")
/* Overrides value in */
/* filename statement */
cc=("miguel@acme.com" "loren@acme.com")
subject="My SAS Output"
attach=("C:\sas\results.out" "C:\sas\code.sas")
;
put 'Folks,';
put 'Attached is my output from the SAS';
put 'program I ran last night.';
put 'It worked great!';
run;filename reports email "Jim.Smith@work.com";
data _null_;
file reports;
length name dept $ 21;
input name dept;
put '!EM_TO! ' name;
put '!EM_SUBJECT! Report for ' dept;
put name ',';
put 'Here is the latest report for ' dept '.' ;
if dept='marketing' then
put '!EM_ATTACH! c:\mktrept.txt';
else /* ATTACH the appropriate report */
put '!EM_ATTACH! c:\devrept.txt';
put '!EM_SEND!';
put '!EM_NEWMSG!';
put '!EM_ABORT!';
datalines;
Susan marketing
Peter marketing
Alma development
Andre development
;
run;filename outbox email
to='susan@site.com'
type='text/html'
subject='Temperature Conversions';
data temperatures;
do centigrade = -40 to 100 by 10;
fahrenheit = centigrade*9/5+32;
output;
end;
run;
ods html
body=outbox /* Mail it! */
rs=none;
title 'Centigrade to Fahrenheit Conversion Table';
proc print;
id centigrade;
var fahrenheit;
run;