View previous topic :: View next topic
|
Author |
Message |
chhabraravneet
New User
Joined: 04 Oct 2007 Posts: 49 Location: Mumbai
|
|
|
|
Hi,
Trying to execute the below code, but i am not getting any attachment. Instead, what i am trying to attach is coming in email body itself.
Plese help:
//PWSTEP03 EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD SYSOUT=(B,SMTPT)
//SYSUT1 DD DISP=SHR,DSN=USSERID.TEST.EMAIL1
// DD DISP=SHR,DSN=USERID.TEST.EMAIL
//
/*
USSERID.TEST.EMAIL1 consists of:
HELO JOBTRAC
MAIL FROM:<XYZ@XYZ.COM>
RCPT TO :XYZ@XYZ.COM
DATA
FROM: XYZ@XYZ.COM
TO: XYZ@XYZ.COM
SUBJECT: JOB COMPLETED (SEE ATTACHMENT)
MIME-VERSION: 1.0
CONTENT-TYPE: TEXT/PLAIN
CONTENT-DISPOSITION: ATTACHMENT; FILENAME="XYZZ.TXT"
USERID.TEST.EMAIL consits of the attachment.
Both the files have same DCB parametres.
thanks for the help. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
start with the links provided in this thread
if that does not answer your question, you can always search the jcl forum with a search key of: email + attachement |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
You have included the "attachment" as part of the actual e-mail text. . . |
|
Back to top |
|
|
chhabraravneet
New User
Joined: 04 Oct 2007 Posts: 49 Location: Mumbai
|
|
|
|
Thanks Dick.
Then how to include the attachment..i dont want to include it in email text..
Regards, |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
dbzTHEdinosauer wrote: |
start with the links provided in this thread
if that does not answer your question, you can always search the jcl forum with a search key of: email + attachement |
i re-quote my earlier comment, since you seem to have missed it,
since i directly do not provide the control cards you need,
and you obviously have to dig for the answer yourself.
or, do you feel that we should just waste space repeating
what has be posted in other forums
and/or
what the manual/documentation provides?
am i missing something here? |
|
Back to top |
|
|
chhabraravneet
New User
Joined: 04 Oct 2007 Posts: 49 Location: Mumbai
|
|
|
|
Hi Dick Brenholtz ,
Obviously you guys should not waste time in repeating the stuff and positng it again and again.
But i read your column and the chains that you provided. I did everything included the simple boundaries...changed my MIME command..but its not working. Moreover the threads that you provided too are not enough..as in that thread ultimately people are stuck with the same thing (not able to attach in emai) or they have been told to contact the email support group of their site.
As of now im stuck with this...and studing MIME...and trying to write/find the exact jcl code... |
|
Back to top |
|
|
Naish
New User
Joined: 07 Dec 2006 Posts: 82 Location: UK
|
|
|
|
Tried from the suggested link. This works.
Code: |
//STEP010 EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD SYSOUT=B,DEST=SMTP
//SYSUT1 DD *
HELO JESNDIXA
MAIL FROM:<from-mail-id>
RCPT TO:<to-mail-id>
DATA
FROM: MAINFRAME
TO: to-mail-id
SUBJECT: TEST ATTACHMENT
MIME-VERSION: 1.0
CONTENT-TYPE: TEXT/PLAIN
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=FILE.TXT
// DD DISP=SHR,DSN=user-id.TEST.JCL(EMAILATT)
// DD DISP=OLD,DSN=user-id.TEST.JCL(EMAILAT)
|
|
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
Back to top |
|
|
chhabraravneet
New User
Joined: 04 Oct 2007 Posts: 49 Location: Mumbai
|
|
|
|
Thanks a lot guys...for all your inputs...
i got it and it worked...
the last issue that i was facing was..my attachment file was coming from a sysprint..so if was always VBA and getting its own record length..
so i changed my control card to the same parametres as that of the attachment file that i was creating from the sysprint..ie kept all as VBA, same record lenght and same block size..and it worked..
thank you once again.... |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
You're welcome - and thank you for the followup explaining your solution
d |
|
Back to top |
|
|
David Robinson
Active User
Joined: 21 Dec 2011 Posts: 199 Location: UK
|
|
|
|
I'm seem to be getting an issue not covered off in any of the other posts. I can send a text e-mail fine, an e-mail with an attachment fine, and an e-mail with both...up to a point.
What happens when I try and send text in the e-mail plus an attachment is that I lose all the line breaks in the body text so the resultant e-mail is just one line.
Any ideas? Are any special control characters required? The MIME docs that I have read talk about CRLF to start a new line which is x'0D0A' in ASCII but I don't know what would be required on the mainframe. |
|
Back to top |
|
|
David Robinson
Active User
Joined: 21 Dec 2011 Posts: 199 Location: UK
|
|
|
|
Further reading tells me that x'0A' in ASCII maps to x'25' in EBCDIC, so that implies that x'0D25' should do the trick, but it's still no good.
I've tried every combination of x'0A', x'0D' and x'25' that I can think of, without any success.
Any suggestions? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
From RFC 2821:
Quote: |
2.3.7 Lines
SMTP commands and, unless altered by a service extension, message
data, are transmitted in "lines". Lines consist of zero or more data
characters terminated by the sequence ASCII character "CR" (hex value
0D) followed immediately by ASCII character "LF" (hex value 0A).
This termination sequence is denoted as <CRLF> in this document.
Conforming implementations MUST NOT recognize or generate any other
character or character sequence as a line terminator. Limits MAY be
imposed on line lengths by servers (see section 4.5.3).
In addition, the appearance of "bare" "CR" or "LF" characters in text
(i.e., either without the other) has a long history of causing
problems in mail implementations and applications that use the mail
system as a tool. SMTP client implementations MUST NOT transmit
these characters except when they are intended as line terminators
and then MUST, as indicated above, transmit them only as a <CRLF>
sequence. |
In other words, unless your mail client supports use of some specific character sequence to work as a line termination sequence, you cannot specify line terminators in an email. I haven't researched what the "service extension" could be -- and even if that has an answer to your problem, you'd have to worry about every link in the message handling that service extension the same way. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
Back to top |
|
|
David Robinson
Active User
Joined: 21 Dec 2011 Posts: 199 Location: UK
|
|
|
|
I have managed to resolve this now, and it was nothing to do with having a <CRLF> string. As others have said, MIME is very sensitive to positions, blank lines, etc., and although my original job was identical to an example posted here, for some reason it didn't work.
I've just tried various other examples on a trial and error basis and found one that worked fine (thanks to Robert's JCL on the link that Anuj provided).
Many thanks to everyone for your help and suggestions. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Thanks for the feedback. Yes, Robert is one of the excellent contributors on this board. |
|
Back to top |
|
|
|