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

Send Mail using COBOL


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Manigandan Aravindhan

New User


Joined: 09 Oct 2007
Posts: 81
Location: India

PostPosted: Fri Jun 19, 2009 9:58 am
Reply with quote

Dear Friends is there any way to send mail using COBOL program.

Following is my requirement:
While the execution of program, If the count of two variables are not in match then i need to send a mail.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Fri Jun 19, 2009 4:30 pm
Reply with quote

While I haven't done it, if you assign a DD name to your site SMTP and write properly formatted records to that file, the email should be sent when you close the file. If you don't know the record formats, Google RFC 2821 and that IETF document will give you the details.
Back to top
View user's profile Send private message
Manigandan Aravindhan

New User


Joined: 09 Oct 2007
Posts: 81
Location: India

PostPosted: Fri Jun 19, 2009 5:15 pm
Reply with quote

We use to invoke pgm SMTPMAIL while sending mail thru JCL.
Is there any possible way to invoke it from COBOL....
Like call 'SMTPMAIL' USING <some parameters> needed.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Fri Jun 19, 2009 5:30 pm
Reply with quote

Now that would depend upon your site, wouldn't it? You need to contact your site support group, find out where the SMTPMAIL program came from, and proceed based on that. If SMTPMAIL is nothing but a pass through for the SMTP commands, then it will be trivial to use it from COBOL. If SMTPMAIL is a vendor product, someone from your site will need to contact the vendor for details about using the product as a subprogram.
Back to top
View user's profile Send private message
Manigandan Aravindhan

New User


Joined: 09 Oct 2007
Posts: 81
Location: India

PostPosted: Fri Jun 19, 2009 6:05 pm
Reply with quote

I can find the load of the program SMTPMAIL from Linklib. Where do i found code or how can i understand the machine language.........
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Fri Jun 19, 2009 6:11 pm
Reply with quote

Manigandan Aravindhan wrote:
how can i understand the machine language.........
LOL-- probably no one can. You may try your luck searching for SMTPMAIL under ISRDDN though or in the base library of source module at your shop -- that's site specific.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Fri Jun 19, 2009 6:51 pm
Reply with quote

Manigandan,

Search the forum as this had been discussed before.

I had used IEBGENER to send mails.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Jun 19, 2009 11:21 pm
Reply with quote

Hello,

One way to do what you want is to code your program to set a specific non-zero return code when then e-mail needs to be sent and then use a conditional iebgener step to send the mail as Aaru mentioned.

You also could try writing the e-mail directly out of the cobol program to the same destination you would use to send via iebgener/smtp.

Suggest that you do not make this overly complicated. . .
Back to top
View user's profile Send private message
Manigandan Aravindhan

New User


Joined: 09 Oct 2007
Posts: 81
Location: India

PostPosted: Wed Jun 24, 2009 6:05 pm
Reply with quote

Dear All,
Thanks for the suggestions given by you all.
I had did it in cobol pgm by caling the program SMTPMAIL.

The suggestion gave by Dick is really a good one but my client didnt accepted that to happen.

once again thanks a lot to everyone to spend yours valuable time in this topic. icon_smile.gif
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top