View previous topic :: View next topic
|
Author |
Message |
valyk
Active User
Joined: 16 Apr 2008 Posts: 104 Location: South Carolina
|
|
|
|
I am writing to a TDQ that is allocated like the following:
Code: |
TDqueue : SMTP
Group : MYGROUP
DEscription :
TYPE : Extra Extra | INTra | INDirect
EXTRA PARTITION PARAMETERS
DAtabuffers : 001 1-255
DDname : MAIL
DSname :
Sysoutclass :
Erroroption : Ignore Ignore | Skip
Opentime : Initial Initial | Deferred
REWind : Leave | Reread
TYPEFile : Output Input | Output | Rdback
RECORDSize : 00080 0-32767
BLOCKSize : 0-32767
RECORDFormat : Fixed Fixed | Variable
BLOCKFormat : Blocked Blocked | Unblocked
Printcontrol : A | M
DIsposition : Shr Shr | Old | Mod |
This is how the MAIL DD is allocated:
Code: |
//MAIL DD SYSOUT=(B,SMTP) |
I write to the TDQ, my task ends, but the email does not send. I closed the TDQ, but it still does not send. The email is finally sent when the region is shut down.
This is what I am writing:
Code: |
HELO MY.MAIL.SERVER.COM
MAIL FROM:<CICS@.MY.MAIL.SERVER.COM>
RCPT TO:<ME@MY.MAIL.SERVER.COM>
DATA
TO: <ME@MY.MAIL.SERVER.COM>
FROM: <CICS@MY.MAIL.SERVER.COM>
SUBJECT: TEST SMTP MESSAGES
THIS IS A TEST |
I tried appending 'QUIT', but it just treated it like a string in the body of the email. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Where's the period? And yes, you need QUIT as well.
See this example or read up on how to properly code for the SMTP protocol. |
|
Back to top |
|
|
valyk
Active User
Joined: 16 Apr 2008 Posts: 104 Location: South Carolina
|
|
|
|
Ok. Now my SMTP string looks like the following:
Code: |
HELO MY.MAIL.SERVER.COM
MAIL FROM:<CICS@.MY.MAIL.SERVER.COM>
RCPT TO:<ME@MY.MAIL.SERVER.COM>
DATA
TO: <ME@MY.MAIL.SERVER.COM>
FROM: <CICS@MY.MAIL.SERVER.COM>
SUBJECT: TEST SMTP MESSAGES
THIS IS A TEST
.
QUIT |
Still no luck... |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1745 Location: Tirupur, India
|
|
Back to top |
|
|
valyk
Active User
Joined: 16 Apr 2008 Posts: 104 Location: South Carolina
|
|
|
|
Yes. My installation uses class B.
The issue is not that the mail is not being delivered. It is making it to the destination, just not when the transaction is being executed. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
Did you CLOSE the TDQ, or did you CLOSE & DISABLE the TDQ? If the first, I'd try doing both to see if that works. You may need FREE=CLOSE on the DD statement as well.
However, IBM's example of sending email to SMTP from CICS is CA1H (hint: Google is your friend) and CA1H uses the SPOOL commands, not a TDQ. I would consider this a very strong hint that TDQ is probably not the way to go when writing SMTP from CICS. |
|
Back to top |
|
|
valyk
Active User
Joined: 16 Apr 2008 Posts: 104 Location: South Carolina
|
|
|
|
Robert Sample wrote: |
Did you CLOSE the TDQ, or did you CLOSE & DISABLE the TDQ? If the first, I'd try doing both to see if that works. You may need FREE=CLOSE on the DD statement as well.
However, IBM's example of sending email to SMTP from CICS is CA1H (hint: Google is your friend) and CA1H uses the SPOOL commands, not a TDQ. I would consider this a very strong hint that TDQ is probably not the way to go when writing SMTP from CICS. |
I tried all three. I first did a simple close, then close/disable, then later I freed the DD. All three failed to work.
I think I am in agreement with your last sentence. I don't think writing to a TDQ is a supported function for SMTP.
We talked about writing to the spool and creating a job to simply issue the SMTP commands, but that is very convoluted and would be irritating for someone in the future to come across. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
but that is very convoluted |
Why? IBM has already written the code in CA1H and it is available for download for free. They even have a sample calling program, written in COBOL, that is used to verify the installation. There's not much more than copying, compiling, and adding some CICS table entries to get that solution up and running. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10889 Location: italy
|
|
|
|
and what about understanding the solution ?
Quote: |
but that is very convoluted and would be irritating for someone in the future to come across. |
|
|
Back to top |
|
|
Earl Haigh
Active User
Joined: 25 Jul 2006 Posts: 475
|
|
|
|
phew!, I don't understand why some programmers refuse to ask their
co-workers or their Tech Support people for help.
if your environment is setup to do SMTP email from CICS,
then someone in your shop most already know how to do this. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Earl Haigh wrote: |
phew!, I don't understand why some programmers refuse to ask their co-workers or their Tech Support people for help. |
The poster IS the CICS Systems Programmer. |
|
Back to top |
|
|
valyk
Active User
Joined: 16 Apr 2008 Posts: 104 Location: South Carolina
|
|
|
|
Robert Sample wrote: |
Quote: |
but that is very convoluted |
Why? IBM has already written the code in CA1H and it is available for download for free. They even have a sample calling program, written in COBOL, that is used to verify the installation. There's not much more than copying, compiling, and adding some CICS table entries to get that solution up and running. |
Because the provided samples utilize CICS Sockets. Sockets is only setup in about 10% of our CICS regions. Our shop is massive and I did not want to setup CICS Sockets in every region. I wanted a solution that required a few CSD entries and an interface program that could be transaction invoked and started off the sequential terminal.
This is something that a external hosting costumer requested and I wanted a quick and easy solution.
Instead I just created a step in the CICS region's job to simply read a cardlib and using an IEBGENER, I wrote the SYSUT2 to the SMTP sysout class. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10889 Location: italy
|
|
|
|
Quote: |
Because the provided samples utilize CICS Sockets |
only partially true!
Quote: |
The sample programs show methods of interfacing a CICS application with SMTP. The programs are intended to demonstrate various methods of sending email from within a CICS application. This is accomplished by utilizing either the CICS SPOOL interface or the CICS TCP/IP sockets interface. The SPOOL interface requires the use of the MVS SMTP server. The sockets interface can utilize any SMTP server accessible on the TCP/IP network. |
looks like the TS forgot to read completely the docs ! |
|
Back to top |
|
|
valyk
Active User
Joined: 16 Apr 2008 Posts: 104 Location: South Carolina
|
|
|
|
I'll admit that I did not read the doc thoroughly. I opened the Zip file containing the source code and I saw the calls to EZASOKET and I knew that it was not a route that I wanted to take.
Also, I wanted to see if the TDQ method would work... |
|
Back to top |
|
|
valyk
Active User
Joined: 16 Apr 2008 Posts: 104 Location: South Carolina
|
|
|
|
It looks like I am going to have to eat my words. The batch step did not operate as expected.
So I used the Spool write method.
When I originally said, 'but that is very convoluted and would be irritating for someone in the future to come across.', I thought you were implying that I write a job to the internal reader. |
|
Back to top |
|
|
Earl Haigh
Active User
Joined: 25 Jul 2006 Posts: 475
|
|
|
|
Unemployed and too broke to retire.
That makes two of us..
I'm already practicing for the Job I'll need AFTER
the Java boys push me aside.
"do you want fries with that?"
Earl |
|
Back to top |
|
|
|