Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Unable to send mail with SMTP commands

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Unable to send mail with SMTP commands
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: 1946
Location: UK

PostPosted: Tue Dec 12, 2017 2:03 pm    Post subject:
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    Post subject:
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    Post subject:
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: 8211
Location: Dubuque, Iowa, USA

PostPosted: Tue Dec 12, 2017 3:11 pm    Post subject: Reply to: Unable to send mail with SMTP commands
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    Post subject:
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: 8211
Location: Dubuque, Iowa, USA

PostPosted: Tue Dec 12, 2017 6:17 pm    Post subject:
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    Post subject:
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: 8211
Location: Dubuque, Iowa, USA

PostPosted: Tue Dec 12, 2017 7:38 pm    Post subject:
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    Post subject:
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: 8211
Location: Dubuque, Iowa, USA

PostPosted: Tue Dec 12, 2017 8:01 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Prblem with mail having MIME contents harsh.saxena579 JCL & VSAM 2 Tue Dec 12, 2017 3:48 pm
No new posts Looping REXX - unable to interrupt RAVISANKAR07 CLIST & REXX 3 Wed Dec 06, 2017 1:08 pm
No new posts Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm
No new posts unable to set RC = 4 when empty file migusd SYNCSORT 1 Tue Nov 21, 2017 1:21 am
No new posts Rexx to send an email without SMTP Se... upendrasri All Other Mainframe Topics 12 Sun Nov 19, 2017 7:59 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us