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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 11 replies
  • 5915 views
  • 0 likes
  • 3 in conversation