BookmarkSubscribeRSS Feed
SASHunter
Obsidian | Level 7
Hi all,

I am attempting to send an email from my local PC SAS to my Lotus Notes email account. Or to my home email whichever. I have tried both. The code runs fine and it opens Lotus Notes and starts an e-mail with the data in the body and the TO: and SUBJECT: correct, but it does not actually SEND the e-mail. I have to push the send button from within Lotus Notes.

How can I actually get it to SEND the e-mail without my intervention?

Here is the simple code I am testing:

%let username = myname ;
FILENAME mymail EMAIL
To= (&username@mycompany.com)
SUBJECT="Testing version for PC SAS Email" ;
DATA _null_;
FILE mymail;
PUT "Good Morning,";
PUT " " ;
PUT "Have a nice day,";
PUT " " ;
PUT " : ) ";
RUN;


Thanks for any advice with this.

Nancy
5 REPLIES 5
ChendhilKumar
Calcite | Level 5
Could you try by including FROM in the file name statement..?

FILENAME mymail EMAIL
FROM= (&username@mycompany.com)
TO= (&username@mycompany.com)
SUBJECT="Testing version for PC SAS Email" ; Message was edited by: ChendhilKumar
SASHunter
Obsidian | Level 7
Hi,

Thanks for your reply -
I tried to add in the FROM: line, but that does not change anything. It stills just opens up in Lotus Notes and waits for me to hit the SEND button.

I also saw a SAS Usage Note 9641
http://support.sas.com/kb/9/641.html
saying that I may have to update the WIN.INI file. So I added the lines it said, but still nothing.

Any other suggestions?

Thanks, Nancy
Bill
Quartz | Level 8
Nancy;

It's likely that some security settings are preventing full automation. Adding the following lines to sasv9cfg (sas config file) fully automates the send. You will have to customize for your environment.

/*Next 4 lines unique to my setup*/
-xwait off
-emailhost=usenet.domain.ca **your setting here
-emailsys=SMTP
-emailid "SASHunter@domain.ca" **your setting here
SASHunter
Obsidian | Level 7
Bill - thanks for your reply

First of all I don't exactly know what the emailhost name is. I am using lotus notes and I have found under preferences that my server name is IT010HQLNM/HQ/BOC.

I put this in my config file and I get the following:
ERROR: Email host it010hqlnm/hq/boc not found.

Can you tell me how to find my domain (or host name) I guess they are the same?
Also, is my regular email address that I would give to someone, my emailid?
When I called our Support people they said our domain is BOC. I tried that also and it doesn't work either.

I really want to get this mail to automatically be sent.

Thanks, Nancy
SASHunter
Obsidian | Level 7
Hi all,

I finally got this to work correctly. This is what I finally found after searching the internet.

First - I had to find my mail server name, so I did this:
Opened DOS window and did the following:
ping mail.mycompany.com

this gave me my mail IP Address.

So, in the config file I added these lines that Bill talked about:
-xwait off /* Don's know if you need this or not but it's there */
-emailhost=my.mail.ip.address /* 148.xxx.xx.xxx */
-emailsys=SMTP

Saved the SAS9.2.cfg file

FILENAME mymail EMAIL
To= 'myusername@mycompany.com'
SUBJECT="Testing version for PC SAS Email" ;
DATA _null_;
FILE mymail;
PUT "Good Morning,";
PUT " " ;
PUT "Have a nice day,";
PUT " " ;
PUT " : ) ";
RUN;


I ran the program and it finally automatically SENT the email. It didn't have to wait
for me to hit the SEND button.

Hope this helps someone else.

Have a good day! Nancy

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 8612 views
  • 2 likes
  • 3 in conversation