Hi, Below is the sample code I am using to send out an automated email with some text and one of my data set in the body of my email. However, when I receive the email the text show in a table form which I don't want. I just want the data set to appear in a table form. I want the output / email to show as Code: /* 1. Define a more aggressive custom style */ PROC TEMPLATE; DEFINE STYLE STYLES.NO_TABLE_TEXT; PARENT=STYLES.JOURNAL; /* Target the main body and page containers to strip borders and background */ CLASS BODY / BACKGROUNDCOLOR=WHITE HTMLSTYLE="border:none;"; CLASS PAGE / HTMLSTYLE="border:none;"; CLASS SYSTITLEANDFOOTERCONTAINER / HTMLSTYLE="border:none;"; /* *** CRITICAL ADDITION *** The ODS TEXT output is often treated as a REPORT section. Force it to have no rules/frame. */ CLASS REPORT / RULES=NONE FRAME=VOID HTMLSTYLE="border:none; margin: 0; padding: 0;"; /* Ensure no space/border */ /* Another container element to strip */ CLASS TABLE / RULES=NONE FRAME=VOID HTMLSTYLE="border:none; margin: 0; padding: 0;"; END; RUN; * 1. Set the email system options; Options emailsys=smtp emailid="sample@email.com" EMAILHOST="mail.net" EMAILPORT=25; * 2. Define the email file reference; FILENAME outbox EMAIL TO=("sample@email.com") SUBJECT="Report - &tday." IMPORTANCE="HIGH" SENSITIVITY="CONFIDENTIAL" CONTENT_TYPE="text/html" TYPE="text/html" ATTACH=("&out.Report_&tday..xlsx"); ods tagsets.msoffice2k body=outbox STYLE=NO_TABLE_TEXT; ods text = "Good morning,"; ods text = " "; ods text = "Please see attached report for &tday."; ods text = " "; ods text = "Thanks"; ods text = " "; ods text = "PS"; ods text = " "; ods text = "&comparison_result"; ods text = " "; proc print data=Change noobs; VAR _ALL_ / STYLE(COLUMN)={CELLWIDTH=0.7in} STYLE(HEADER) = {FONTWEIGHT=BOLD BACKGROUNDCOLOR=White FOREGROUND=Black } STYLE(DATA) = {BORDERCOLOR=black BACKGROUNDCOLOR=WHITE FOREGROUND=BLACK} ; run; ods tagsets.msoffice2k close; filename outbox clear;
... View more