BookmarkSubscribeRSS Feed
pervamatt
Calcite | Level 5

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;

 

11 REPLIES 11
SuryaKiran
Meteorite | Level 14

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
pervamatt
Calcite | Level 5

No luck. It still came from the personal account.

SuryaKiran
Meteorite | Level 14

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
pervamatt
Calcite | Level 5

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

 

SuryaKiran
Meteorite | Level 14

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
pervamatt
Calcite | Level 5

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

jasonfor
Calcite | Level 5

Hello Suryakiran,

 

Do you know how I can permanently change my EMAILACKWAIT system option?  By default it is set to 30 seconds but I believe I might need more time.  I am currently receiving an error that the email was able to send due to the connection to my mail server being interrupted.  Thank you.

SuryaKiran
Meteorite | Level 14

Check SAS Documentation on this here.

Thanks,
Suryakiran
jasonfor
Calcite | Level 5

I actually came across this documentation but this looks like I would have to use this in code.  Is there any way to make this at a higher level?

SuryaKiran
Meteorite | Level 14

Look for that in your configuration file and update there. 

 

Note: If this is a new issue, why don't you open a new track. You may get responses from other out there or avoids miss leading the actual post for future reference.

Thanks,
Suryakiran
jasonfor
Calcite | Level 5

I was actually trying to avoid opening a SAS Tech support ticket.  I came across this track and figured you could help.  I will open ticket to figure out what config file I need to make the change.  Thank you.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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