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

Sending mail through mainframes - query again


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
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
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

Global Moderator


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

PostPosted: Fri May 07, 2010 7:06 pm
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: 8697
Location: Dubuque, Iowa, USA

PostPosted: Fri May 07, 2010 7:27 pm
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
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: 8697
Location: Dubuque, Iowa, USA

PostPosted: Fri May 07, 2010 8:32 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts SH256/MD5 Checksum in Mainframes JCL JCL & VSAM 14
No new posts RC query -Time column CA Products 3
No new posts Dynamically pass table name to a sele... DB2 2
No new posts Query on edit primary command CLIST & REXX 5
No new posts Query on edit primary command CLIST & REXX 1
Search our Forums:

Back to Top