Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Sending mail through mainframes - query again

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
Agni

New User


Joined: 22 Nov 2007
Posts: 83
Location: Chennai

PostPosted: Fri May 07, 2010 6:33 pm    Post subject: Sending mail through mainframes - query again
Reply with quote

Hi All,

I am trying to send mail from the mainframes. I have searched the forum to my level best but my problem is not solved yet. I had asked a query about this topic earlier but this is different.

I tried to send the mail using IEBGENER. Please find my code as below.

Code:

//S02MAIL  EXEC PGM=IEBGENER                               
//SYSIN    DD DUMMY                                       
//SYSPRINT DD SYSOUT=*                                     
//SYSUT2   DD SYSOUT=(B,SMTP)                             
//SYSUT1   DD *                                           
HELO RMBJES                                               
MAIL FROM:<XXXX.YYYY@ABC.CO.UK>       
RCPT TO:<XXXX.YYYY@ABC.CO.UK>         
DATA                                                       
FROM:     XXXX.YYYY@ABC.CO.UK         
TO:       XXXX.YYYY@ABC.CO.UK         
SUBJECT:  TEST MESSAGE FROM MVS USING SMTP                 
THIS IS A LINE IN THE BODY OF THE NOTE.                   



I submitted the job. Return code was zero. But i didn't get the mail. So i tried with IKJEFT01 utility.

Code:


//XXXXX   JOB 1,'AGNI - APPS SUPPORT',CLASS=S,NOTIFY=&SYSUID, 
//S02MAIL  EXEC PGM=IKJEFT01,DYNAMNBR=90                       
//SYSEXEC  DD DSN=SYS1.SISPEXEC,DISP=SHR                       
//SYSTSPRT DD SYSOUT=*                                         
//SYSTSIN  DD DSN=MY.PDS(SMTP),DISP=SHR                     
//SUBJECT  DD DSN=MY.PDS(SUBJECT),DISP=SHR                   
//FROM     DD DSN=MY.PDS(FROM),DISP=SHR                     
//TO       DD DSN=MY.PDS(TO),DISP=SHR                       
//CC       DD DSN=NULLFILE                                     
//BCC      DD DSN=NULLFILE                                     
//BODY     DD DSN=MY.PDS(BODY),DISP=SHR                     



In the above JCL, i tried to use SYS3A.PPG.CLIST in the SYSEXEC DD instead of SYS1.SISPEXEC first. But it was not available. Then using TSO ISRDDN command i found out the SYSEXEC dataset. But when i submitted the above job i got the following error message.

Code:


READY                                         
%SMTPSEND PREFIX                             
IKJ56500I COMMAND SMTPSEND NOT FOUND         
READY                                         
END                                           



Then i tried to get the SMTP status using TSO SMSG SMTP STATS which threw the message as follows:

Code:

EZY2045I SMSG: SMTP not logged on


I still didn't leave it. I tried again the following command.

tso xmit rmbjes.smtp da('my.ps.file')

I got the below message.

Code:

INMX000I 0 message and 2 data records sent as 829 records to RMBJES.SMTP
INMX001I Transmission occurred on 05/07/2010 at 13:59:54.               


But I don't know where to see the transmitted file. So does this succesful transmit mean SMTP is working?

Can some one please help me?

Cheers
Agni
Back to top
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Fri May 07, 2010 7:06 pm    Post subject: Reply to: Sending mail through mainframes - query again
Reply with quote

What about the IBM-supplied utility SMTPNOTE?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8055
Location: East Dubuque, Illinois, USA

PostPosted: Fri May 07, 2010 7:27 pm    Post subject:
Reply with quote

Code:
//S02MAIL  EXEC PGM=IEBGENER                               
//SYSIN    DD DUMMY                                       
//SYSPRINT DD SYSOUT=*                                     
//SYSUT2   DD SYSOUT=(B,SMTP)                             
//SYSUT1   DD *                                           
HELO RMBJES                                               
MAIL FROM:<XXXX.YYYY@ABC.CO.UK>       
RCPT TO:<XXXX.YYYY@ABC.CO.UK>         
DATA                                                       
FROM:     XXXX.YYYY@ABC.CO.UK         
TO:       XXXX.YYYY@ABC.CO.UK         
SUBJECT:  TEST MESSAGE FROM MVS USING SMTP                 
THIS IS A LINE IN THE BODY OF THE NOTE.
This is not a valid email. It will not, under any circumstances, ever be delivered.

If you check RFC 2821 and RFC 2822, which are the official requirements for SMTP emails, or even search this forum where I have talked about this in other topics, you will find that you are absolutely required to have a line with a period in the first column and nothing else on that line as the last line of your email. Leave off this period, and the email is not valid and will not be sent.
Back to top
View user's profile Send private message
cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Fri May 07, 2010 8:25 pm    Post subject: Reply to: Sending mail through mainframes - query again
Reply with quote

This works for me. I believe you can have issues with your note if you don't have a blank line after the SUBJECT: line.

Code:

HELO SMTP.COM                                                     
MAIL FROM: <MAIL.ROOM@MYCOMPANY.COM>                               
RCPT TO: JIM.SHORTS@MYCOMPANY.COM                                   
DATA                                                                   
TO: JIM.SHORTS@MYCOMPANY.COM                                         
FROM: DO.NOT.REPLY@MYCOMPANY.COM                                         
DATE:                                                                 
SUBJECT: THIS IS A TEST SUBJECT LINE                     
                                                                       
Don't forget to mail the bosses package.                                           


We frequently and successfully send individual notes without a period in position one, however, if you are sending many notes under the same JCL step, each note must be separated by a line with a period in position one. Failure to do this will cause some of your emails not to be delivered. I found this out when I sent out about 200 emails and only about 50 were actually received.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8055
Location: East Dubuque, Illinois, USA

PostPosted: Fri May 07, 2010 8:32 pm    Post subject:
Reply with quote

From RFC 2821:
Quote:
Klensin Standards Track [Page 17]

RFC 2821 Simple Mail Transfer Protocol April 2001


DATA <CRLF>

If accepted, the SMTP server returns a 354 Intermediate reply and
considers all succeeding lines up to but not including the end of
mail data indicator to be the message text. When the end of text is
successfully received and stored the SMTP-receiver sends a 250 OK
reply.

Since the mail data is sent on the transmission channel, the end of
mail data must be indicated so that the command and reply dialog can
be resumed. SMTP indicates the end of the mail data by sending a
line containing only a "." (period or full stop). A transparency
procedure is used to prevent this from interfering with the user's
text (see section 4.5.2).

The end of mail data indicator also confirms the mail transaction and
tells the SMTP server to now process the stored recipients and mail
data.
If you are sending emails without a period at the end, either your site is adding it automatically without your knowledge, or you are not using SMTP to do so. Based on what you said about multiple emails not being sent, I suspect your site adds it without you knowing it.
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 -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Omegamon for DB2 query ashek15 DB2 0 Wed Feb 15, 2017 11:25 am
No new posts Query on DB2 WLM stored procedures ashek15 DB2 8 Sun Feb 12, 2017 11:13 pm
No new posts GETMAIN/FREEMAIN query Suja.Sai CICS 9 Tue Jan 31, 2017 12:01 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us