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

How to send mail using JCL


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

New User


Joined: 09 Dec 2008
Posts: 23
Location: india

PostPosted: Tue Feb 23, 2010 1:43 pm
Reply with quote

Hi All,

How to send mail from mainframe using JCL in RTF format?

Regards, Vishal
Back to top
View user's profile Send private message
replytovishu

New User


Joined: 09 Dec 2008
Posts: 23
Location: india

PostPosted: Tue Feb 23, 2010 1:52 pm
Reply with quote

I am currently using IEBGENER.
Getting the mail in Plain Text.
want to have it in Rich text format and font as courier new.

Regards, Vishal
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1693
Location: Tiruppur, India

PostPosted: Tue Feb 23, 2010 3:30 pm
Reply with quote

You can try the below code as your email header and the actual text content beneath this header.

Rename the attachemnt as .RTF instead of .TXT.
attachment will be considered as RTF document in Courier new 10pt font.

If you need further formatting of your RTF document such as bold, italics etc.. then u gotta use some software like SAS to generate a report and write it out in RTF format.

For sending basic plain text this below header will be sufficient I guess.

Code:
HELO DUDES                                     
MAIL FROM:<XXX.XXX.COM>                       
RCPT TO: <YOUR.NAME@COMPANY.COM>             
DATA                                                 
FROM:     MAINFRAME                                   
TO:       UNDISCLOSED                                 
SUBJECT: SOME REPORT NAME                     
MIME-VERSION: 1.0;                                   
CONTENT-TYPE: TEXT/RICH TEXT;                         
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=ANALYSIS.RTF
Back to top
View user's profile Send private message
replytovishu

New User


Joined: 09 Dec 2008
Posts: 23
Location: india

PostPosted: Tue Feb 23, 2010 4:35 pm
Reply with quote

But for me the report is not going as attachment.
Let me explain the scenario in more detail:
Step 1--> is executing a program and creating a report file.
Step 2--> is using IEBGENER utility and sending the file as a mail body in plain text

my problem is I want to send it in Rich text (in message body only) and font as Courier new

Regards, Vishal
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1693
Location: Tiruppur, India

PostPosted: Tue Feb 23, 2010 5:03 pm
Reply with quote

I assume that u are using SMTP,

Look closely at what IEBGENER step does. It will have a DSN with SMTP header. Amend the header to the code above in previous post.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Tue Feb 23, 2010 5:47 pm
Reply with quote

Quote:
my problem is I want to send it in Rich text (in message body only) and font as Courier new
You are aware, I hope, that this means you are going to have to embed the RTF formatting in the document itself? The mainframe won't automatically generate the RTF formatting commands and the font data by itself? Either you write a program to generate the RTF data yourself, or you use a program (or utility) that generates this data for you. In any case, if you don't SEND the data in RTF format, why on earth would you expect to RECEIVE it in RTF format?
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Tue Feb 23, 2010 6:07 pm
Reply with quote

Thinking about the possible products that are available to generate data in the RTF format, it seems to me that most of them are also capable of emailing that same data.
Back to top
View user's profile Send private message
replytovishu

New User


Joined: 09 Dec 2008
Posts: 23
Location: india

PostPosted: Wed Feb 24, 2010 11:51 am
Reply with quote

//*----------------------------------------------------------
//JS0030 EXEC PGM=IEBGENER,COND=(4,LT)
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD SYSOUT=B,DEST=(<some name>,SMTP)
//SYSIN DD DUMMY
//SYSUT1 DD DSN=<file name having report>,DISP=SHR

I am using this job ...now please tell where to add what...

Regards,
Vishal
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1693
Location: Tiruppur, India

PostPosted: Wed Feb 24, 2010 12:48 pm
Reply with quote

Quote:
file name having report
wat header content does this have?
Amend the stuff inside this.



Its worth trying Robert's and Kev's Suggestions.
Back to top
View user's profile Send private message
replytovishu

New User


Joined: 09 Dec 2008
Posts: 23
Location: india

PostPosted: Wed Feb 24, 2010 4:29 pm
Reply with quote

But if I put
MIME-VERSION: 1.0;
CONTENT-TYPE: TEXT/RICH TEXT;
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=ANALYSIS.RTF

inside file it is sending report as attachment.
I want it as email body.

Regards,
Vishal
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1693
Location: Tiruppur, India

PostPosted: Wed Feb 24, 2010 5:22 pm
Reply with quote

This link has the details,
www.uic.edu/depts/accc/newsletter/adn13/mime.html
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Wed Feb 24, 2010 5:54 pm
Reply with quote

Quote:
inside file it is sending report as attachment.
I want it as email body.
I strongly urge you to use Google and read RFC 2821, 2822, and the z/OS Communications Server manuals on using SMTP. The mainframe uses SMTP to send email messages. If you read the specifications, you will find that plain text (ASCII characters in the range of 1 to 127 in the collating sequence) is all that can be sent using SMTP in the body of the message. If you want RTF in your message body, you can use a mail client that supports such -- but you cannot do that from a mainframe. Period. If you want to send data in RTF format, you must send it as an attachment -- nothing else will work from the mainframe.

To summarize: you cannot send a message from the mainframe and have the body of the message in RTF or anything except plain text characters. This is an Internet standard not a choice.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1693
Location: Tiruppur, India

PostPosted: Wed Feb 24, 2010 6:39 pm
Reply with quote

Quote:
you cannot send a message from the mainframe and have the body of the message in RTF or anything except plain text characters.
mmm...thanks thats informational.
Kindly delete my duplicate post pls made at
Quote:
Posted: Wed Feb 24, 2010 6:25 pm
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19245
Location: Inside the Matrix

PostPosted: Wed Feb 24, 2010 8:51 pm
Reply with quote

Hello,

Quote:
inside file it is sending report as attachment.
I want it as email body.
You can't always get what you want. . . Rolling Stones

You need to either use the tools as provided or create your own tool that does what you think you need. . .
Back to top
View user's profile Send private message
replytovishu

New User


Joined: 09 Dec 2008
Posts: 23
Location: india

PostPosted: Thu Feb 25, 2010 1:45 pm
Reply with quote

Thanks Everybody for your inputs.
I have changed the report to come as attachment.

still have one query.
want to have report as attachment <Done>

and only one line as message body.

Regards, Vishal
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Feb 25, 2010 2:37 pm
Reply with quote

replytovishu wrote:
still have one query.
want to have report as attachment <Done>
Are you asking a question or making a statement? I hope you know, how to send a mail as an attachment?

No - search the forum on "mail" and author as "Robert Sample" - you'll get enough links to start with.
Back to top
View user's profile Send private message
replytovishu

New User


Joined: 09 Dec 2008
Posts: 23
Location: india

PostPosted: Thu Feb 25, 2010 2:52 pm
Reply with quote

Thanks all.

Now i am able to do it.
We can do it with the help of Content type: multipart/mixed;

and then having two differnt content types inside the above one.
first one having only text for message body
and second one having attachment.

Many many thanks to Vasanth.S..
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1693
Location: Tiruppur, India

PostPosted: Thu Feb 25, 2010 7:00 pm
Reply with quote

Glad to hear you got it sorted icon_smile.gif
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1693
Location: Tiruppur, India

PostPosted: Mon Mar 01, 2010 6:08 pm
Reply with quote

Quote:
you cannot send a message from the mainframe and have the body of the message in RTF or anything except plain text characters. This is an Internet standard not a choice.


Hi Robert,
I respectfully disagree.
I came across an article where HTML content can be sent via SMTP and the HTML content on the body of the email.

The link:
www.zjournal.com/pdfIssue/pdfArticle/Johnston.zJ.Dec-Jan07.pdf

I tried it out and it was working with a sample report, additionally an instream image was also working. Not tried with RTF though. So IMHO I believe mainframe can handle much more stuff than plain text characters.

Pls Correct me if I am wrong.

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

Global Moderator


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

PostPosted: Mon Mar 01, 2010 8:17 pm
Reply with quote

Uh, HTML is plain text -- it encodes the layout using no non-display characters, right?
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1693
Location: Tiruppur, India

PostPosted: Mon Mar 01, 2010 9:07 pm
Reply with quote

I agree with html thats the reason i added saying about in stream image. Which is non displayable content
Back to top
View user's profile Send private message
cthokala

New User


Joined: 24 Oct 2007
Posts: 3
Location: JBurg

PostPosted: Wed Mar 03, 2010 5:08 pm
Reply with quote

I have a query on this, if I want to send a email with 10000 records, is it possible?

Regards,
Chandra
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1693
Location: Tiruppur, India

PostPosted: Wed Mar 03, 2010 5:30 pm
Reply with quote

Hi, Welcome to the forum icon_smile.gif

What happened when u tried to email 10000 recs.?
Back to top
View user's profile Send private message
cthokala

New User


Joined: 24 Oct 2007
Posts: 3
Location: JBurg

PostPosted: Wed Mar 03, 2010 5:34 pm
Reply with quote

Hi Vasanth,
Thanks.
The job abend with S722, even though its abending I am getting mail with 1988 records only.


Chandra
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1693
Location: Tiruppur, India

PostPosted: Wed Mar 03, 2010 5:46 pm
Reply with quote

Hi,

S722 - TIMEOUT (OUTPUT LIMIT REACHED, JOB EXCEEDED NUMBER OF ALLOWABLE LINES)
Maybe try to add a JOBPARM after the jobcard, it MIGHT work

Code:
/*JOBPARM LINES=999999
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 Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts parmeter existence bit for URIMAP in ... CICS 1
No new posts Send email without SMTP All Other Mainframe Topics 5
No new posts Send text at cursor position on an IS... CLIST & REXX 10
No new posts Unable to send mail via CSSMTP to GMA... JCL & VSAM 2
No new posts JCL to send email along with formated... JCL & VSAM 5
Search our Forums:

Back to Top