BookmarkSubscribeRSS Feed
dapstat
Fluorite | Level 6

I am running Windows Server on an Amazon virtual desktop (AWS).  64 bit dual processors.  SAS 64 bit windows server edition.

 

I need to be able to send emails automatically from sas code.  I have it setup for SMTP.  

 

I get the error message connection refused.  

 

Just trying to execute a simple example as follows:

 


options emailsys=SMTP emailid='daniel.parry@trudecision.com';
filename mailbox email;
data _null_;
file mailbox to='daniel.parry@praxis-llc.com' subject='MAPI test';
put "Hi";
run;

 

email settings in sas set to smtp, localhost, port 25, etc.

 

I have researched this extensively.  I went into my windows registry and there are no software policies set up for outlook, and I don't get a pop up that says another program is trying to send an email.  Just that the connection was refused.

 

Please help

5 REPLIES 5
ballardw
Super User

You might post the exact message, screen capture or if there is any message in the SAS log post that as well along with the code.

 

I'm going to guess this ends up involving who/what has permissions where.

ChrisHemedinger
Community Manager

If you have console access to the Windows server, can you try using the Send-MailMessage command in a PowerShell window?  That might tell you whether the system is set up for SMTP mail properly to begin with.  If you get that working, then you know it's possible to get it working in SAS.

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
dapstat
Fluorite | Level 6

I had the same problem when I was running desktop sas on my own personal laptop.  

 

I am running a virtual desktop in the cloud.  There is no company, just me as an independent consultant, so no over-arching IT security interference.  

 

There are no software policies in the windows registry.  I'm using microsoft outlook, and it is set as the default program.  My email is through godaddy, hosted by office365 (outlook.office365.com).  I've gone to the settings for my email server with godaddy and outlook365, and there's nothing on the admin page that restricts.  I'm not getting a popup that tells me another program is trying to send email.  I saw another post that said don't use port 25, use port 2525.  I tried both.  

 

I am attaching my screenshots.  


sas error log window.pngsas log startup.png
sas options email settings.pngsas program window.pngwindows computer settings.png
ChrisHemedinger
Community Manager

When sending mail though a provider like Office 365, you probably need to provide some additional authentication and maybe even configure your e-mail provider to allow such programmatic access.  After all, you don't want just anyone with your e-mail address and knowledge of a port number to be able to send e-mail on your behalf.

 

See this blog post for what's required.  It specifically talks about Gmail, but the same protocols are probably in place for any tier-1 cloud-based email provider.

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
dapstat
Fluorite | Level 6

Ok, so I have made progress on this issue. 

 

I set up a gmail account, and downloaded a free email program (thunderbird).  I setup my new gmail on my virtual machine using thunderbird.

 

I changed thunderbird to default email.   Ran my sas email, and it worked perfectly.

 

I set up my domain on godaddy, and subscribe to office365 exchange.  I can set another email up on my company's domain but not run it through office365 (let google host my email).  That should solve my problem.

 

I will post back with results.

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
  • 5 replies
  • 6119 views
  • 1 like
  • 3 in conversation