DATA Step, Macro, Functions and more

Email Attachment not working

Reply
Regular Contributor
Posts: 184

Email Attachment not working

The following works perfectly except it is not attaching excel file. When this code runs, it is sending email notification but no attachment in the email notification. I tried the different file and format (txt) for attachment but still not working.

FILENAME OUTBOX EMAIL;

DATA _NULL_;

FILE OUTBOX

SUBJECT = "Status : Macro"

FROM = "abc@gmail.com"

TYPE = 'TEXT/PLAIN'

TO = ("abc@gmail.com")

ATTACH= ("/user/ujjawal/file1.xlsx");

PUT "Check logfile to see whether there is any error";

RUN;

SAS Super FREQ
Posts: 8,868

Re: Email Attachment not working

Hi:

  The location of the attachment must be available to the e-mail server. This is something that you need to check with your email administrators.

cynthia

Super Contributor
Super Contributor
Posts: 3,174

Re: Email Attachment not working

Posted in reply to Cynthia_sas

Interesting - for both SAS Windows and SAS z/OS (IBM mainframe), I use a remote "SMTP mail server" although my ATTACH=(....) file is local to the system where SAS is executing.  Does that jive with your experience, Cynthia?

Scott Barry

SBBWorks, Inc.

SAS Super FREQ
Posts: 8,868

Re: Email Attachment not working

Ah, I don't use a remote SMTP server. I suppose it is possible for it to work differently...About ATTACHE=, the doc says only that "The physical name is the name that is recognized by the operating environment."

cynthia

Ask a Question
Discussion stats
  • 3 replies
  • 257 views
  • 0 likes
  • 3 in conversation