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

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;

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

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

3 REPLIES 3
Cynthia_sas
SAS Super FREQ

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

SAS_Parilla
Calcite | Level 5

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.

Cynthia_sas
SAS Super FREQ

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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 3 replies
  • 1533 views
  • 3 likes
  • 2 in conversation