2
在EMAIL中使用帶EM_ *指令的以下代碼時,我應該在電子郵件地址前使用outlook(我使用Outlook 2010)中的別名「XYZ」,並且在收件箱視圖中只使用別名。 Outlook收到的電子郵件沒有別名。如何使用EM_SENDER和EM_FROM指令將電子郵件別名命名爲SAS?
Filename MAILBOX email CT="text/html" ;
Data _null_ ;
length HTML_DirLine $ 2048 ;
fid = fopen('MAILBOX','O');
/* write the TO email address */
HTML_DirLine = '!EM_TO! ("[email protected]")' ;
fputrc1 = fput(fid,trim(HTML_DirLine));
rc = fwrite(fid);
/* write the FROM email address */
HTML_DirLine = '!EM_FROM! (" XYZ <[email protected]>")' ;
fputrc1 = fput(fid,trim(HTML_DirLine));
rc = fwrite(fid);
/* write the SENDER email address */
HTML_DirLine = '!EM_SENDER! (" XYZ <[email protected]>")' ;
fputrc1 = fput(fid,trim(HTML_DirLine));
rc = fwrite(fid);
/* write the Subject email address */
HTML_DirLine = '!EM_SUBJECT! Test Email ' ;
fputrc1 = fput(fid,trim(HTML_DirLine));
rc = fwrite(fid);
/* write the Body of email message */
HTML_DirLine = 'This is the test email. Pls ignore.' ;
fputrc1 = fput(fid,trim(HTML_DirLine));
rc = fwrite(fid);
/* Send the email message */
HTML_DirLine = '!EM_SEND!' ;
fputrc1 = fput(fid,trim(HTML_DirLine));
rc = fclose(fid);
run ;
但是,當我沒有指令使用它工作正常。以下是代碼,
Filename mailbox EMAIL ;
Data _null_ ;
File mailbox TO='[email protected]'
Subject='Test Email message'
from='XYZ <[email protected]>'
sender='XYZ <[email protected]>' ;
put "Hi There,"
put "Please ignore this test email" ;
run ;
有關如何使別名正確顯示使用SAS中的指令的任何建議?由於
謝謝。有效。我的代碼的問題是圓括號之間的空格。當我開始向後推薦您的建議並添加括號時,我的代碼也起作用了。 'code' HTML_DirLine ='!EM_FROM! (「XYZ <[email protected]>」)'; HTML_DirLine ='!EM_SENDER! (「XYZ <[email protected]>」)';'代碼' – user4288151