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: 124
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: 8700
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: 2594
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: 1337
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 Run rexx with JCL Job CLIST & REXX 1
No new posts Run rexx in batch job CLIST & REXX 7
No new posts Does anyone know rexx for VSE CLIST & REXX 3
No new posts TSO ALLOC In REXX Needs Improvement JCL & VSAM 3
No new posts Copy only TEXT or String from a record SYNCSORT 4
Search our Forums:

Back to Top