Sas emails connection refused

Reply
Occasional Contributor
Posts: 7

Sas emails connection refused

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

Super User
Posts: 11,343

Re: Sas emails connection refused

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.

Community Manager
Posts: 2,955

Re: Sas emails connection refused

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.

Occasional Contributor
Posts: 7

Re: Sas emails connection refused

Posted in reply to ChrisHemedinger

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
Community Manager
Posts: 2,955

Re: Sas emails connection refused

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.

Occasional Contributor
Posts: 7

Re: Sas emails connection refused

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.

Ask a Question
Discussion stats
  • 5 replies
  • 398 views
  • 1 like
  • 3 in conversation