DATA Step, Macro, Functions and more

SAS Email Functionality Outlook

Reply
Occasional Contributor
Posts: 7

SAS Email Functionality Outlook

Hello,

I have an Outlook account where I have access to 2 email accounts, my personal account and a business account. I am using the code below to try and send from the business account, but no matter what the email always comes from my personal account.

 

Is there a setting or something I am missing? 

 

In this code below, the inventory_planning emailid is the business account, and mperva is my personal. 

 

OPTIONS EMAILSYS=MAPI EMAILID = 'inventory_planning';
FILENAME MAILBOX EMAIL;

DATA _NULL_;
FILE MAILBOX TO= 'mperva@xxx.com'
SUBJECT = 'TEST';
PUT 'HI,';
PUT 'HOW ARE YOU TODAY?';
PUT 'HERE IS YOUR FILE';
RUN;

 

Valued Guide
Posts: 559

Re: SAS Email Functionality Outlook

Posted in reply to pervamatt

Hi,

Try this

 

Filename outbox clear;
filename outbox email FROM="abc@xyz.com" ;
data _null_;
file outbox
to=("xyz@abc.com")
subject ="Hello";
PUT "Thanks";
PUT "Kiran";
run;

Filename outbox clear;

Thanks,
Suryakiran
Occasional Contributor
Posts: 7

Re: SAS Email Functionality Outlook

Posted in reply to SuryaKiran

No luck. It still came from the personal account.

Valued Guide
Posts: 559

Re: SAS Email Functionality Outlook

Posted in reply to pervamatt

Check your email host by running the below code. Probably you need to change that to your work host.

 

proc options group=email;
run;

Thanks,
Suryakiran
Occasional Contributor
Posts: 7

Re: SAS Email Functionality Outlook

Posted in reply to SuryaKiran

Here's the result, not sure how to interpret:

 

12 proc options group=email;
13 run;

SAS (r) Proprietary Software Release 9.4 TS1M4


Group=EMAIL
EMAILACKWAIT=30 Specifies the number of seconds to wait for the SMTP server acknowledgement.
EMAILAUTHPROTOCOL=NONE
Specifies the SMTP e-mail authentication protocol.
NOEMAILFROM Does not require the FROM e-mail option when sending e-mail by using the FILE or
FILENAME statements.
EMAILHOST=LOCALHOST
Specifies one or more domain names for SMTP e-mail servers.
EMAILID= Specifies the SAS user's logon ID, profile or e-mail address.
EMAILPORT=25 Specifies the port number for the SMTP e-mail server that is specified in the
EMAILHOST option.
EMAILPW=XXXXXXXX Specifies the password for the e-mail address specified by the EMAILID option.
EMAILUTCOFFSET= For SMTP e-mail sent using the FILENAME statement, specifies a UTC offset that is
used in the Date header field of the e-mail message.
EMAILDLG=NATIVE Specifies whether to use the native e-mail dialog box that is provided by your
e-mail application or the e-mail dialog box that is provided by SAS.
EMAILSYS=MAPI Specifies the e-mail protocol to use for sending electronic mail.
NOTE: PROCEDURE OPTIONS used (Total process time):
real time 0.15 seconds
cpu time 0.09 seconds

 

Valued Guide
Posts: 559

Re: SAS Email Functionality Outlook

Posted in reply to pervamatt

Change your host to business site.

 

options emailsys=smtp emailhost=your.smtpemail.server.com emailport=25;

 

emailhost is SMTP server specific to your site. Check with your email admin to get the correct SMTP email server name and port 25 is common but check with admin to verify. 

 

Thanks,
Suryakiran
Occasional Contributor
Posts: 7

Re: SAS Email Functionality Outlook

Posted in reply to SuryaKiran

OK. Let me reach out them and see if I can get the server name.

Ask a Question
Discussion stats
  • 6 replies
  • 137 views
  • 0 likes
  • 2 in conversation