Desktop productivity for business analysts and programmers

HOW TO EMAIL WITH ALL ATTACHMENTS IN A FOLDER

Reply
Occasional Contributor
Posts: 13

HOW TO EMAIL WITH ALL ATTACHMENTS IN A FOLDER

Hi Every one,

i have  a folder with 5 excel files i want to write code automate email with all that attachments please help.

 

 

Thanks

Srinivas

Esteemed Advisor
Posts: 6,706

Re: HOW TO EMAIL WITH ALL ATTACHMENTS IN A FOLDER

When you wrote your question, you had this right below:

Stop right there! Before pressing POST, tick off this checklist. Does your post …

✔ Have a descriptive subject line, i.e., How do I ‘XYZ’? ✔ Use simple language and provide context? Definitely mention what version you’re on. ✔ Include code and example data? Consider using the SAS Syntax feature.

 

 

 

 

 

Note "provide context".

- how are you using SAS (single machine, client/server, On Demand, SAS Studio, Enterprise Guide, Batch)?

- do you have certain capabilities like XCMD which allows you to use the X statement?

- if you have XCMD, which operating system is your SAS process running on?

- where are the Excel files located (on the same machine as SAS, or on another, so that a network connection is needed)?

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Respected Advisor
Posts: 3,840

Re: HOW TO EMAIL WITH ALL ATTACHMENTS IN A FOLDER

[ Edited ]

@srinivaschary

Writing a subject line all in upper case is considered screaming as far as I know. Is this what you intended to do? Scream at us?

 

There are quite a few code examples in white papers and also in the SAS documentation. Using Google with the following search term will bring up helpful links:  site:*.sas.com 9.4 email attachment

 

I suggest you try one of the examples and shouldn't you be able to make things work for you then come back with your code and SAS log and tell us what you've tried, what's currently not working and what you have and need.

 

Also: Try to split your big problem into smaller problems

1. Can you send an email at all?

2. Can you send an email with a single attachment?

3. Can you send an email with multiple attachments?

 

By splitting up the big problem into chunks you'll help yourself and us as it will allow you to ask targeted questions for the parts you can't make work and we then can concentrate on the bits which you can't resolve instead of discussing "everything" where most of it won't be relevant to your actual challenge.

Esteemed Advisor
Esteemed Advisor
Posts: 7,253

Re: HOW TO EMAIL WITH ALL ATTACHMENTS IN A FOLDER

Just to note, email generally has limits - I can't receive anything bigger than 10mb for instance.  Email isn't the best method for distributing reports, look at secure portals, web publishing, network drives and such like.

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