Hi,
I've got SAS 9.3, and I'm writing a job data step which will be scheduled at some time, and I'd like to send a report email at the end of the process.
I'm trying using a gmail account, but as far as I read there is no way to do it because of the gmail ssl protocol.
Is there no way at all? I read that two solutions are upgrading to sas 9.4 (unfortunately we can't) or use the email feature from sas EG (but I need to do it in a data step since the job is scheduled and it is independent of the EG). Should I give up? Are there other solutions?
Thank you very much in advance.
Regards
The ssl/tls requirement is holding your mail/smtp option off. The most easy circumvention is finding a mail provider not requiring ssl (until 9.4)
HI,
try this..
filename sendmail email
to="xxx@sas.com"
cc=("xxx@yyy.co.in"
)
bcc="urname@zzz.com"
from="urname@zzz.com"
subject="About email"
attach="/sasdata/test.xls" /*sample attachemnt*/
type="text/plain";
data _null_;
file sendmail;
put "Hi,";
Put " ";
put "Email notification:";
put " ";
put "Regards,";
put "urname";
run;
Message(s) received from the pipe command:
/bin/bash: /data/sas/config/Lev1/SASApp/MAPI: No such file or directory
ERROR: Email could not be sent
thank you, I'm trying using an open smtp server on port=25, but I've found out that the sas server is behind a proxy server like 'http:/proxy:port/config.pac'. How can I deal with this new issue?
Thanks a lot
Can you paste the code which you are trying to create email notification.
try this ..
#!/bin/bash: /data/sas/config/Lev1/SASApp/MAPI:
To be able to send mail all conditions outside the SAS environment must be met.
==> Your machine must be able to get to a mail-server not being blocked by firewalls
Often it is known as a bulk-mail authorisation. It is locked-down by the wish of preventing spam.
Your mail guys should be able to tell you.
Often this is locked-down totally with firewall's as the access to an external world would also open up black-hat hack opportunities.
Your network guys should be able to tell you.
With a more simple hosting providers usage (like home conenctions) many of the ports like 25 are closed by them but your external connection is open.
You external mail provider should offer you an other port like 487 (just an exampel) for this.
You could check this using the telnet client (adres port). It will always fail but the message why it fails is more interesting. Failing by no access (firewall) or wrong protocol (ah,,,, mail should work)
==> Your mail-protocol should be understood. There are more parameters often needed to be set.
If the one that is offering (SAS) the protocol and the provider are not well cooperating you are into a deadlock.
Unfortunately, the security protocol that GMail uses is not supported in the FILENAME EMAIL mechanism until SAS 9.4. You've probably seen these articles, but I'll post for the group:
Chris
Thank you for all your suggestions, unfortunately the sas server machine I'm using is very poorly configured and limited, and I don't have an admin-like access to configure it, so I didn't succeed to do any of the solutions you proposed, also because of the proxy server.
Anyway, I managed it in another "dirty" way: first, I wrote a simple php page hosted on some server which gets the email parameters (recipients, subject, body, ...) through the POST method and send the email; then, in sas code I call such a page using html post (which has also parameters to set the proxy server). Therefore, the sas batch builds the email parameters for the report and passes them to the php page through POST, and the php page gets the parameters and send the report by mail.
I admit it is a little bit twisted, but it works great!
Thank you again for your help.
Regards
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.