BookmarkSubscribeRSS Feed
Win9
Calcite | Level 5

I have the below code

 

%let to = name@email.com;  

 %let name = name;  

 %let report = Daily Status Report; 

  filename mymail email "&to"    

  type = "TEXT/HTML"    

  subject = "Report Status";

   

 

  data _null_;     

  file mymail;       

  put '<html><head>';      

  put '<style type="text/HTML" MEDIA=screen><!--'; 

  put 'body { color: #346170; font-family: Verdana; font-size: 10pt; }';      

  put '.errorMessage { color: Red; font-size: 8pt; }';      

  put '--></style></head><body>';      

  put 'name -<br /> The following reports are complete:';      

  put '<ul><li>Daily Status Report</li>';  

  put '<button type="button" >ACCEPT!</button>'; /* this two lines I have added but didn't work*/

  put '<button type="button">REJECT!</button>';

  put '</body></html>';   

  run;

 

I have attached the screenshot of the email as needed.

3 REPLIES 3
ballardw
Super User

Please describe what "didn't work" actually means.

 

Was there an error in the code? If so copy and paste the code and error message(s) from the log into a code box opened using the forum's {I} icon.

Was the email not generated?

Was the email generated but the push buttons didn't appear?

Was the email generate and the push buttons appeared but nothing happens when pushed?

Or something else?

 

 

Win9
Calcite | Level 5

Q)Was there an error in the code? If so copy and paste the code and error message(s) from the log into a code box opened using the forum's {I} icon.

A) There is no error in the code, But in the outlook email the Push button showing as a plain text.

 

Q) Was the email not generated?

A) Yes email generated succesfully

 

Q)Was the email generated but the push buttons didn't appear?

A) Yes, Push button appearing as a plain text

 

Q)Was the email generate and the push buttons appeared but nothing happens when pushed?

Or something else?

A) Yes email generated and push button appeared as a plain text.

Cynthia_sas
SAS Super FREQ

Hi:

  I notice that you don't have content-type="text/html" as shown on the 10-24-2017 entry in this forum post:

https://communities.sas.com/t5/ODS-and-Base-Reporting/how-to-format-text-in-SAS-email-body-bulk-e-ma...

 

  Notice how the content-type is provided on the FILENAME statement. Other things to check -- did your EMAIL system convert the HTML to plain text? Check with your mail administrators. Without a clear content-type for the mail, they may have converted everything.  Some mail systems strip active links and scripts out of mails to prevent malware - again, this is something you need to check at your end of things.

 

  You said that mail was generated successfully. Outside of the mail environment, have you tested whether your HTML page will work when viewed in a browser? I am not completely current on HTML and CSS, but having text/html in the <style> tag may not be enough for your mail system and usually, when I see a <button> tag, there is some kind of "action" or HREF= to "do" something when the button is clicked, as shown here: https://www.copernica.com/en/blog/post/how-to-create-email-buttons-with-just-html-and-css .

 

  The W3Schools site: https://www.w3schools.com/tags/tag_button.asp indicates there are new features for <button> in HTML5 vs HTML4, but since you don't have a <DOCTYPE> tag, you don't tell the mail system what kind of HTML you're sending. Also, the W3Schools site only shows browser support for <BUTTON> so you might want to check with your mail administrators to see whether <BUTTON> in mail is supported by the system you're using for email.

 

  Just a few other suggestions for debugging,

Cynthia

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
  • 869 views
  • 1 like
  • 3 in conversation