IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

REXX to send an email in Mainframe with coloring text


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
upendrasri

Active User


Joined: 28 Sep 2017
Posts: 121
Location: India

PostPosted: Sat Oct 08, 2022 12:10 pm
Reply with quote

Hi All,

as a part of Automation, I am sending an email with the below rexx script.



Code:

/* REXX */                                             
 LPAR = 'TEST LPAR '                                   
SMTP.1 = 'HELO' MVSVAR('SYSNAME')                     
SMTP.2 = 'MAIL FROM:<TEST123@CAP.NET>'                 
SMTP.3 = 'RCPT TO:<TEST123@CAP.NET>'                   
SMTP.4 = 'DATA'                                       
SMTP.5 = 'FROM:<TEST123@CAP.NET>'                     
SMTP.6 = 'TO:<TEST123@CAP.NET>'                       
SMTP.7 = 'SUBJECT:'LPAR'-DETAILS'                     
SMTP.8 =  'These are high priority alerts... '       
"ALLOC F(SMTPOUT) SYSOUT(B) WRITER(SMTP)"             
IF RC <> 0 THEN DO                                     
  SAY 'ERROR ALLOCATING SYSOUT FOR SMTP WRITER'       
  EXIT 12                                             
END                                                   
"EXECIO * DISKW SMTPOUT (STEM SMTP. FINIS"             
IF RC <> 0 THEN DO                                     
  SAY 'ERROR WRITING SYSOUT FOR SMTP WRITER'


Is it possible to color the email body test?

Ex:

These are high priority alerts..

Any suggestions.

Thanks..
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Sat Oct 08, 2022 4:27 pm
Reply with quote

SMTP does not support text colors.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2546
Location: Silicon Valley

PostPosted: Sat Oct 08, 2022 11:00 pm
Reply with quote

Sorry, I am not very familiar with SMTP emails...

Can it be possible to use an attachment that is in rich text format?

You would need to convert your existing report to add RTF tags. (it seems somewhat hard to do). And send that as an attachment. Google for RTF Specification
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1243
Location: Bamberg, Germany

PostPosted: Sun Oct 09, 2022 12:29 pm
Reply with quote

When it is known to be "High Prio" alerts, I would recommend to update the Subject title for the mail. As Pedro has also mentioned, you can send Mails in RTF format (inline) with some formatting applied.

See the following snippet:
Code:
:
Subject: Status                                       
MIME-Version: 1.0                                     
Content-Type: multipart/mixed; boundary="__Xi cc++"   
--__Xi cc++                                           
Content-Type: text/enriched                           
                                                     
<bigger><bigger><bigger>                             
<fixed><bold>Now</bold></fixed>                       
</bigger></bigger></bigger>                           
- Is <italic>time</italic>                           
for <underline>world</underline>                     
peace <smaller>(and <<more>)</smaller>.               
--__Xi cc++--                                         
.                                                     
QUIT                                                 
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Mainframe openings in Techmahnidra fo... Mainframe Jobs 0
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top