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;
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;
No luck. It still came from the personal account.
Check your email host by running the below code. Probably you need to change that to your work host.
proc options group=email;
run;
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
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.
OK. Let me reach out them and see if I can get the server name.
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.
Check SAS Documentation on this here.
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?
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.
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 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.