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

using JCL to email an attachment: email is not being sent


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sushma rao

New User


Joined: 25 Mar 2009
Posts: 1
Location: Noida

PostPosted: Mon Mar 30, 2009 11:22 am
Reply with quote

Hi,

I am trying to email an attachment using JCL. The job is ending with maxcc=0 but the email is not being sent.

My code:

//SENDMAIL EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DISP=SHR,DSN=XXXX.FTPINP
// DD DISP=SHR,DSN=XXXX.OUTPUT
// DD DISP=SHR,DSN=XXXX.CLOSE
//SYSUT2 DD SYSOUT=(B,SMTP),LRECL=417

the DCB parameters of all the three files are RECFM=FB,LRECL=417,BLKSIZE=0

contents of XXXX.FTPINP:

HELO HOST
MAIL FROM: from_id
RCPT TO: to_id
DATA
FROM: from_id
TO : to_id
SUBJECT: REPORT for xxx
MIME-VERSION: 1.0
CONTENT-TYPE: MULTIPART/MIXED; BOUNDARY="MIMEBOUNDARY"
HI,

PLEASE FIND ATTACHED A REPORT.

REGARDS,
TEAM
--MIMEBOUNDARY
CONTENT-TYPE:TEXT/PLAIN; CHARSET="US-ASCII"
CONTENT-TYPE:APPLICATION/OCTET-STREAM; NAME="REPORT.CSV"
CONTENT-DISPOSITION: ATTACHMENT; FILENAME="REPORT.CSV"
CONTENT-TRANSFER-ENCODING: 7-BIT

XXX.OUTPUT is to be sent as attachment.

contents of XXXX.CLOSE :
--MIMEBOUNDARY

The mail is not being sent icon_sad.gif
What can be the error?

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

Global Moderator


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

PostPosted: Mon Mar 30, 2009 4:59 pm
Reply with quote

SMTP requires a line with nothing but a period at the end of the data. Without the period, SMTP doesn't recognize the end of the email and does not send 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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts mail attachment with excel format All Other Mainframe Topics 2
No new posts REXX to send an email in Mainframe wi... CLIST & REXX 3
No new posts REXX to send an email in Mainframe CLIST & REXX 4
No new posts Problem while sending special charact... JCL & VSAM 4
No new posts TXT2PDF and then SMTP email a PDF JCL & VSAM 4
Search our Forums:

Back to Top