- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I have spent days pouring over every note, paper. SAS documentation and even watched the Chris Hemdinger video. I simply cannot get SAS to send an email.
After troubleshooting and trying every combination of SAS email system option (and getting error messages galore) I think this has nothing to do with the data step and everything to do with the email host option. Unfortunately, every guide, every Communities note, etc basically says either "we assume you know how to set up your smtp mail server" or, contact your admin to get your smtp email server.
I am the admin, this is a personal computer, not a work computer and I have no idea what a smtp email server is.
To send and email, I open Firefox, open gmail, log in.
When I first tried sending an email in SAS, I got a message saying no email is associated....
So, I did something I had never done and that was to go to Windows and associate MAIL. I first associated with Firefox, then I tried with Chrome, finally with the Windows 10 recommended MAIL, which apparently opens something called Outlook. In Outlook, I linked several email accounts and one by one tried sending email in SAS.
I have also tried all, and I mean all, of the various SAS system email options/settings in every paper, tip, documentation for each email account, for each smtp association.
I have received a dozen different EMAIL Error messages. Can anybody help me troubleshoot? And yes, I know and submit
proc options group=email;
run;
with every attempt
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
See here first:
https://support.sas.com/resources/papers/proceedings/pdfs/sgf2008/038-2008.pdf
By using EMAILSYS=MAPI, you can use your local mail client (e.g. Outlook).
To use SMTP, you need to get the settings for SMTP from your mail client and configure those into SAS. Or get such settings from elsewhere (in a company or other organization, the mail admin).
Using Firefox with gmail means that in fact nothing mail-specific happens on your computer, everything happens in a web app running on the Google servers. So that path can't be used from inside SAS code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Kurt, but when I set it to MAPI, I get:
ERROR: Undetermined I/O failure
Oh and how do I find out what my local email client is?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
See if this helps you:
https://support.sas.com/kb/41/961.html
Bitness is a major issue when you try to interact with MS software from SAS.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
If you have installed Outlook, that's your email client.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks again, Kurt. I do not think bitness is the issue as I just installed Mozilla Thunderbird for Windows 64 as, what I hope is, my email client. I am using 64-bit install of SAS 9.4 TS1M6.
I was still ignorant in my earlier post and I misspoke. I pointed Windows to the Windows Mail app and, had linked 3 email accounts (hotmail, gmail, and an outlook account). Outlook was never my email client. I was apparently looking at an Outlook account when I said, in my ignorance, that I had installed Outlook.
That said, the new error message with the Thunderbird email client:
ERROR: Email: 550 No SMTP server defined. Use real server address instead of 127.0.0.1 in your account.
I have no idea what a "real" server address is, let alone whatever SAS thinks 127.0.0.1 is.
I am using these SAS options with the Thunderbird app as per the app's references:
options EMAILSYS=smtp;
options emailhost=imap.gmail.com;
but have also tried:
options EMAILSYS=mapi;
options emailhost=smtp.gmail.com;
options EMAILSYS=mapi;
options emailhost=imap.gmail.com;
not that I know what any of that means
but gives me
ERROR: Login failure and a new one
ERROR: Email: The software caused the connection to abort.
apparently there is also something called an outgoing server and an incoming server, which is slightly different. Again, bit of a Luddite and no clue what these mean to SAS.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
To send email (not to retrieve email from a server, which uses IMAP or POP3), all applications use the Simple Mail Transfer Protocol. This must be configured to access a server that takes over handling the mail. Mail clients like Outlook support you in doing that (servernames, ports), but you need a valid mail account for that (e.g. your gmail account).
I suggest that you first set up mail from your PC so that you can send mails from there, and then replicate the SMTP configuration in SAS.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello @texasmfp
As I see it ,there are two scenarios of sending emails using SAS which I have come across.
(There may be other use case but I haven't used them ).
1.Scenarion 1:
To send email from SAS one does need an SMTP server (A server process/ daemon that sends and receives email). In corporate environment generally they have an SMTP server and and the SAS Server has this information configured. Alternatively the SMTP details can be included in your program. As you have researched sending email by SAS you must be having the necessary details. (For those who don't please see SAS documentation of google it). Email can be sent from SAS running on the Desktop or Server.
2.Scenario 2: SAS installed on a personal desktop and no access to own SMTP server.
As I infer from your post, this case applies.
You can use use your google account following the process mentioned in this blog https://blogs.sas.com/content/sasdummy/2013/07/31/gmail-from-sas-program/)
Unless there is a very specific need, it is simpler and easier to use email clients like Thunderbird / Outlook etc. in this scenario.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I finally got it to work. This really had nothing to do with SAS and everything to do with setting up an email client, rebooting a few times, and getting the SAS EMAIL System Options set. The last step was to go into Gmail, locate a very hard to find part of the account settings and enabling 3rd party access to less secure apps. Unfortunately, I saw this message, which suggest that my newfound email ability will go away at the end of May. Looking for alternatives.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
To continue this working, you might need to use the "App password" mechanism. I believe that you first have to enable 2-factor auth on your Google account (a best practice). From my blog post:
If you use two-factor authentication on your Google account (a best practice), then you will need to takean additional step and create an "App password"-- which will allow a third-party app to use Gmail on your behalf and bypass the verification step. As always, your Google password and any App password you generate should be managed carefully and secured.