Page 1 of 1

Sending Email from JCL

PostPosted: Wed May 05, 2010 1:21 pm
by Kaptan.singh
Hi frnds,

I have written a jcl to send email....... I tested it and its working fine

What if i want to send a attachment to the Email being send via jcl..... Is it possible :roll:
Please help me on this

Regards,
Kaptan

Re: Sending Email from JCL

PostPosted: Wed May 05, 2010 2:56 pm
by Robert Sample
What kind of attachment? Plain text? A file containing binary data? Something else?

Re: Sending Email from JCL

PostPosted: Wed May 05, 2010 3:07 pm
by Kaptan.singh
I want to attach a word document.....
(Also what if I want to attach something else. Is there different syntax for each type of attachment)

Re: Sending Email from JCL

PostPosted: Wed May 05, 2010 4:45 pm
by Robert Sample
Since the mainframe does not do Word in any form, exactly how do you think you are going to attach the Word document on the mainframe?

A simple text attachment can be done by SMTP code of
HELO MAINFRAME.xxxxxxxx.COM
MAIL FROM: <MAINFRAME@xxxxxxxx.COM>
RCPT TO: <mail.name@xxxxxxxx.com>
DATA
From:     MAINFRAME@xxxxxxxx.com
To:      mail.name@xxxxxxxx.com
Subject:  Test attachment
MIME-Version: 1.0
Content-Type: text/plain
Content-Disposition: attachment; filename=file.txt
followed by the desired data to be the attachment. Content-Type must match the actual data or there can be side effects -- binary data,for example, will not successfully be transmitted as text/plain.

If you want to find out the different attachment types, Google is your friend. Googling content-type came back with 413,000,000 hits and some of them on the first page explain the whole MIME email concept quite well.