BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
tparvaiz
Obsidian | Level 7

Hi,

 

we use ms outlook 2016 and can you please advise how to send an email to multiple recepients A) with an attachment file and B) short header and body of the email.

 

my attachment is saved on the C drive

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Jagadishkatam
Amethyst | Level 16

I believe the below article will be helpful for your requirement

 

http://www2.sas.com/proceedings/forum2008/038-2008.pdf

 

 

Thanks,
Jag

View solution in original post

6 REPLIES 6
Jagadishkatam
Amethyst | Level 16

I believe the below article will be helpful for your requirement

 

http://www2.sas.com/proceedings/forum2008/038-2008.pdf

 

 

Thanks,
Jag
tparvaiz
Obsidian | Level 7

Hi,

 

I am using code that looks like this

 

%let label = &date.

 

data _null_;
file cmds;
put "[save.as(%bquote("X:\Weekly\File &label..xlsx"))]";
put '[CLOSE()]';
run;

 

FILENAME Mailbox EMAIL 'temp@microsoft.com'
Subject='Test Mail message' ATTACH='X:\Weekly\File May 2017.xls';
DATA _NULL_;
FILE Mailbox;
PUT "Hello";
PUT "Plesae find Report as an attachment";
PUT "Thank you";
RUN;

 

Question: as you can see, when I save my excel file it's using a variable/date as part of the file name but when I am referencing the attachment it's taking constant file name

 

how can I customize it to use variable file name when sending an email attachment, something like this

 

ATTACH='X:\Weekly\File &label..xlsx';

Jagadishkatam
Amethyst | Level 16
when you mention macro variables you have to use double quotes

You can try below

ATTACH="X:\Weekly\File &label..xls";
Thanks,
Jag
tparvaiz
Obsidian | Level 7

Thanks

SASKiwi
PROC Star

Does SAS run on your PC? If so you will be able to pick up local drive attachments. You also need access to an email gateway - an SMTP one in your case.

 

If you are using SAS on a server it would need to be configured to use an SMTP gateway and your attachments would have to be accessible from your server.

Kurt_Bremser
Super User

And how are you using SAS?

- Locally with native Display Manager?

- Locally, but through Enterprise Guide?

- Remotely on a server? If yes, please specify:

  - the server's operating system

  - SAS Studio or Enterprise Guide?

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

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
  • 6 replies
  • 22865 views
  • 0 likes
  • 4 in conversation