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
 

 

Email a file from mainframes as attachment

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
vvmanyam

New User


Joined: 16 Apr 2008
Posts: 86
Location: Bangalore

PostPosted: Thu Jun 25, 2009 2:08 pm    Post subject: Email a file from mainframes as attachment
Reply with quote

Hi friends,
I use below step to email the user with the error report in the body of the email.
Code:

//STEP100  EXEC PGM=IEBGENER                                       
//*                                                                 
//*  SEND E-MAIL MESSAGE WITH THE ERROR REPORT                     
//*                                                                 
//SYSIN    DD  DUMMY                                               
//SYSUT1   DD  DSN=TEST.EMAIL.ADDRESS,DISP=SHR                     
//         DD  DSN=TEST.EMAIL.CONTENT,DISP=SHR                     
//*OUTPUT                                                           
//SYSUT2   DD  SYSOUT=(B,STPRSMTP)                                 


TEST.EMAIL.CONTENT is the error report.

Details of TEST.EMAIL.ADDRESS:
Code:

HELO ONCGHP4.TESTING.COM               
MAIL FROM:<MAINFRAME@ONCGHP4>           
RCPT TO:<TEST.EMAIL@US.TESTING.COM>     
DATA                                     
DATE:                                   
SUBJECT: EXCEPTION REPORT FOR TESTING   
                                         


But I want to send the email with the reprot as an attachment.
What changes should I make to do so?

Thanks,
Balu
Back to top
View user's profile Send private message

gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Thu Jun 25, 2009 3:07 pm    Post subject:
Reply with quote

Hi,

see this http://ibmmainframes.com/viewtopic.php?t=31751&highlight=sample+text


Gerry
Back to top
View user's profile Send private message
vvmanyam

New User


Joined: 16 Apr 2008
Posts: 86
Location: Bangalore

PostPosted: Thu Jun 25, 2009 4:17 pm    Post subject:
Reply with quote

Thanks for the link !!
I have tested that
But I am still receiving the email with file in the body of the mail but not as an attachment.
More over all these statements also in the email itself.
MIME-VERSION, CONTENT-TYPE TEXT/P, CONTENT-DISPOSITION, etc

Code:
//SYSIN    DD  DUMMY                                     
//SYSUT1   DD  DSN=TEST.TRN.MAILSEND,DISP=SHR       
//         DD  DSN=TEST.TRN.REPORT,DISP=SHR       
//         DD  DSN=TEST.TRN.PERIOD,DISP=SHR         
//*OUTPUT                                                 
//SYSUT2   DD  SYSOUT=(B,STPRSMTP)                       
//SYSPRINT DD  SYSOUT=*                                   


Content:TEST.TRN.MAILSEND
Code:

HELO ONCGHP4.TESTING.COM               
MAIL FROM:<MAINFRAME@ONCGHP4>           
RCPT TO:<TEST.EMAIL@US.TESTING.COM>                 
DATA                                                         
DATE:                                                         
SUBJECT: ERROR LOADING FUND TABLE                             
                                                             
   !!!PELASE FIND THE ATTACHED ERROR REPORT!!!!               
                                                             
MIME-VERSION: 1.0                                             
CONTENT-TYPE: TEXT/PLAIN                                     
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=ERRORFILE.TXT       

TEST.TRN.REPORT is my report.
What should be there in TEST.TRN.PERIOD?
I have put one '.'
Is that fine?
Please let me know if any error in the above steps.
Thanks,
Balu
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7935
Location: Bellevue, IA

PostPosted: Thu Jun 25, 2009 5:11 pm    Post subject:
Reply with quote

SMTP requires an email end with a period on a line by itself. That is what is supposed to be in TEST.TRN.PERIOD. If it's not showing up as you want, you may need to review (and possibly get a trace from) the STPRSMTP address space output. Depending upon your site, this may require site support group help.
Back to top
View user's profile Send private message
vvmanyam

New User


Joined: 16 Apr 2008
Posts: 86
Location: Bangalore

PostPosted: Thu Jun 25, 2009 5:23 pm    Post subject:
Reply with quote

Thanks for the quick reply
But, I am sorry.I haven't got what you said!

Quote:
SMTP requires an email end with a period on a line by itself.

Will system automatically put a dot in to that dataset?

Quote:
If it's not showing up as you want

There is no attachment, every thing is in body itself.
What changes might help to get the report in attachment.

Thanks,
Balu[/code]
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7935
Location: Bellevue, IA

PostPosted: Thu Jun 25, 2009 5:29 pm    Post subject:
Reply with quote

Quote:
Will system automatically put a dot in to that dataset?
No, that's why you have to put one there. If it is not present, SMTP flat out refuses to send the email.

If you're not getting the attachment, you need to work with your site support group to trace the SMTP process and see what's going on from mainframe to mail server to mail client.
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Are there any Freeware utilties for i... johnmull IBM Tools 2 Wed Dec 21, 2016 8:29 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm


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