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

I use the EMAIL device to send email through SAS from a Linux system. This works just fine in most cases, but when I attach an .xlsx file the file somehow gets corrupted. When I receive the email, everything looks good, but Excel can’t open the attachment. It gives an error message "We found a problem with some content in..." and then "Excel cannot open the file...". I see that the documentation for the EMAIL device has an option CONTENT_TYPE='content_type', but no indication what the possible values are. Is there a particular content type that should be specified? Or is there something else that needs to be done to allow .xlsx files to be attached? I’ve seen a post here from 2013 with the same problem, but no resolution. Below is code used:

filename em

email ("&emailaddr.")

       to = ("&emailaddr.")

       subject = "Test"

       attach = ("/amex2/ramp/misc/gsc_glob/tashelly/ods/GCG_Unique_CM_201911.xlsx")

       emailid = "&emailaddr."

;

 

data _null_;

file em;

put "Test";

run;

1 ACCEPTED SOLUTION

Accepted Solutions
tomrvincent
Rhodochrosite | Level 12
attach=
(
"foobar.xlsx" content_type="application/xlsx" lrecl=32000
)

View solution in original post

1 REPLY 1
tomrvincent
Rhodochrosite | Level 12
attach=
(
"foobar.xlsx" content_type="application/xlsx" lrecl=32000
)

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
  • 1 reply
  • 1171 views
  • 1 like
  • 2 in conversation