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

Unable to send mail with SMTP commands


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
harsh.saxena579

New User


Joined: 11 Dec 2017
Posts: 7
Location: India

PostPosted: Tue Dec 12, 2017 1:58 pm
Reply with quote

Hi!

I have written a REXX to generate a report file. Now I want to send an automatic mail to all receivers.

I am using IEBGENER to send mail, but I want report in a particular format, as in default format it is misaligned and not readable.

For test purpose, The parm member of my IEBGENER is as follows:

Code:
MAIL FROM: xxxxxxxxx@xxxxxx.com           
RCPT TO: xxxxxxxxxx@xxxxxxxx.com         
DATA                                     
FROM: xxxxxxxxx@xxxxxx.com               
TO: xxxxxxxxxx@xxxxxxxx.com               
SUBJECT: Test Mail SMTP                   
                                         
MIME-Version: 1.0                         
Content-type: multipart/mixed;           
              boundary="simple boundary" 
 HTML Format text                         
--simple boundary                         
Content-type: text/html                   
<font face="Courier" size="+2" color=blue>
This is Courier font in blue</font>       
<br><br>                                 
--simple boundary--                     


When I am running the JCL, I am receiving the mail but the entire body content of parm is received i.e.,

Code:
MIME-Version: 1.0                         
Content-type: multipart/mixed;           
              boundary="simple boundary" 
 HTML Format text                         
--simple boundary                         
Content-type: text/html                   
<font face="Courier" size="+2" color=blue>
This is Courier font in blue</font>       
<br><br>                                 
--simple boundary--

The JCL step is as follows:


Code:
//MAIL1  EXEC PGM=IEBGENER                 
//SYSUT1   DD DSN=PARM.DATASET.NAME,DISP=SHR
//SYSUT2   DD SYSOUT=E,DEST=(N4,R110)     


Can someone help me, where I am wrong?
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Tue Dec 12, 2017 2:03 pm
Reply with quote

Yes, you used color tags instead of code tags.
Back to top
View user's profile Send private message
harsh.saxena579

New User


Joined: 11 Dec 2017
Posts: 7
Location: India

PostPosted: Tue Dec 12, 2017 2:08 pm
Reply with quote

I didn't get you .. Can you please explain Nic? icon_neutral.gif
Back to top
View user's profile Send private message
harsh.saxena579

New User


Joined: 11 Dec 2017
Posts: 7
Location: India

PostPosted: Tue Dec 12, 2017 2:10 pm
Reply with quote

Even if I am sending a single MIME command, then also I am getting the content as mail.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Tue Dec 12, 2017 3:11 pm
Reply with quote

SMTP with MIME is EXTREMELY sensitive to the format of the message; sometimes just having one character off will cause the message to fail or not be delivered in MIME format. Search this forum for some of my earlier responses; I provided an example of a fully functioning MIME formatted message a few years ago. I suspect at least one of your problems is the lack of blank lines before your message boundaries.
Back to top
View user's profile Send private message
harsh.saxena579

New User


Joined: 11 Dec 2017
Posts: 7
Location: India

PostPosted: Tue Dec 12, 2017 3:52 pm
Reply with quote

Okay Robert,

I will go through the topics to find your post.
But I have tried with many SMTP with MIME examples. None working. Not even a simple one.

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

Global Moderator


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

PostPosted: Tue Dec 12, 2017 6:17 pm
Reply with quote

Quote:
But I have tried with many SMTP with MIME examples. None working. Not even a simple one.
This is definitely a sign you are impatient. IIRC, it took me DOZENS of tries before I got SMTP with MIME working on z/OS, even on a simple message.
Back to top
View user's profile Send private message
harsh.saxena579

New User


Joined: 11 Dec 2017
Posts: 7
Location: India

PostPosted: Tue Dec 12, 2017 6:25 pm
Reply with quote

No Sir,

I am actually trying implementing it for a long time. and no one in my organization have idea about.

Neither one could tell whom to contact.
Its just that's why, I am asking icon_wink.gif
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Tue Dec 12, 2017 7:38 pm
Reply with quote

You do not have
Code:
CONTENT-DISPOSITION: ATTACHMENT
(there is more to this statement required so you'll need to do some research) hence you have not told SMTP that you want an attachment so naturally the data is put in the body of the email.
Back to top
View user's profile Send private message
harsh.saxena579

New User


Joined: 11 Dec 2017
Posts: 7
Location: India

PostPosted: Tue Dec 12, 2017 7:41 pm
Reply with quote

I do not want attachment, All i want is text format and font changed as I have mentioned.

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

Global Moderator


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

PostPosted: Tue Dec 12, 2017 8:01 pm
Reply with quote

In other words, you have no idea about SMTP and what it does or how it works -- you need to find the SMTP RFC and read it. FYI, text formatting and fonts are NOT under the control of the host (sending) system -- the mail client (Outlook, Lotus Domino, or whatever) has control of the format and font of the message. There is NOTHING you can do with SMTP to force any other situation. Furthermore, SMTP uses 7-bit ASCII characters; if you want anything else you must use MIME to encode it. So what you are asking to do is IMPOSSIBLE using the tools you have, so it is no surprise you have not been successful.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Unable to retrieve Datasets Names usi... CLIST & REXX 20
No new posts TXT2PDF and then SMTP email a PDF JCL & VSAM 4
No new posts Unable to display comp variable COBOL Programming 4
No new posts parmeter existence bit for URIMAP in ... CICS 1
No new posts ISPF Panel commands DDLIST /LISTBOX TSO/ISPF 11
Search our Forums:

Back to Top