The SAS Output Delivery System and reporting techniques

E-Mail Proc Output via ODS

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

E-Mail Proc Output via ODS

Problem: When I open the resluting e-mail, I see the raw HTML code.   This occurs with Hotmail, Outlook 2010, Yahoo Mail, and Google Mail.

I got the code below from SAS Filename documentation

Is there a solution.

Thanks

filename outbox email

                to      = 'me@work.com'

                type    = 'text/html'

                subject = 'Temperature Conversions';

ods html body       = outbox 

         rs         = none;

data work.temperatures;

     do centigrade  = -40 to 100 by 10;

         fahrenheit = centigrade * 9 / 5 + 32;

         output;

     end;

run;

title 'Centigrade to Fahrenheit Conversion Table';

proc print data = work.temperatures;

     id  centigrade;

     var fahrenheit;

run;

title;

ods html close;


Accepted Solutions
Solution
‎01-28-2012 08:06 PM
SAS Super FREQ
Posts: 8,743

E-Mail Proc Output via ODS

Hi:

  I don't generally send HTML in the body of an email anymore, since so many mail adminstrators only want plain text in the body of the email and want HTML (or other file types) sent as an attachment. So I use the method that you see on page 7-8 of my "Greatest Hits" paper,

http://support.sas.com/resources/papers/proceedings11/300-2011.pdf (my paper shows RTF instead of HTML -- but that is the only difference).

  If you need help figuring out what's happening, you might check with your mail administrators to see whether they prohibit sending /receiving HTML tags in the body of a mail. You might also want to open a track with Tech Support on this, so they can walk you through the various diagnostics (what operating system, what mail clients, what  mail method (SMTP, POP), startup mail configuration, mail-related system options, etc).

cynthia

View solution in original post


All Replies
Solution
‎01-28-2012 08:06 PM
SAS Super FREQ
Posts: 8,743

E-Mail Proc Output via ODS

Hi:

  I don't generally send HTML in the body of an email anymore, since so many mail adminstrators only want plain text in the body of the email and want HTML (or other file types) sent as an attachment. So I use the method that you see on page 7-8 of my "Greatest Hits" paper,

http://support.sas.com/resources/papers/proceedings11/300-2011.pdf (my paper shows RTF instead of HTML -- but that is the only difference).

  If you need help figuring out what's happening, you might check with your mail administrators to see whether they prohibit sending /receiving HTML tags in the body of a mail. You might also want to open a track with Tech Support on this, so they can walk you through the various diagnostics (what operating system, what mail clients, what  mail method (SMTP, POP), startup mail configuration, mail-related system options, etc).

cynthia

New Contributor
Posts: 3

E-Mail Proc Output via ODS

Thank you.

Ironic since the ultimate goal was to send short SAS generated emails which contain hyperlinks to SAS generated Excel (XML) files.These files tend to be very large and our E-Mail administrator definitely does not like them.   So it's back to our non-programmaticworkarounds for the time being.  I'll try a different track.  It only software.  Thanks for the reference.

SAS Super FREQ
Posts: 8,743

Re: E-Mail Proc Output via ODS

Hi:

  Even if you don't send an ANCHOR tag or fully formatted HTML tags in the body of the mail, you can still provide a URL or a file location in a plain text email. See the attached screen shot. It created an email using the code below. At least, with the plain text information, someone can cut and paste the URL into a browser or plug the physical location into an Explorer window.

cynthia

** test URL in email;

   

filename doemail email to='xxx.yyy@mycompany.com'

                       from='aaa.bbb@yourcompany.com'

                       type='text/plain'

                       subject='Testing url (not hyperlink) in mail';

   

data _null_;

    file doemail;

    put 'this is a test with url.';

    put 'Find the report file at: ';

    put 'http://www.w3.org/MarkUp/Guide/Style.html';

    put 'Or, go to a shared drive and retrieve the file:';

    put '\\machine-name\directory\subdir\filename.ext';

run;

  

filename doemail clear;


use_url_in_mail_body.jpg
☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 375 views
  • 3 likes
  • 2 in conversation