Subj : Re: Use functions To : comp.programming From : mwojcik Date : Wed Jul 13 2005 05:32 pm In article , "Phlip" writes: > futureofai wrote: > > > I need to send an email and receive an email using my program. My > > program is in COBOL and as you know it has no features to access mail > > servers and so on. I can write to a file and read input from a file. Is > > there any way I can achieve this? > > Google blat. Then shell from COBOL to it. That won't do the OP much good if he's using a non-Windows platform. It also doesn't support "receiv[ing] an email". That isn't a well- defined requirement, of course; there are numerous extant email mechanisms, and they implement the receive-message feature in differ- ent ways. (Is the incoming message to be received directly by the application, eg over an incoming SMTP conversation? Is it to be fetched from an MTA, eg with POP3 or IMAP? There are other possibili- ties.) > COBOL can shell, like system(""), right? Not as part of the standard language; it's not always a meaningful operation. Where it is meaningful, there's generally an implemen- tation extension. That might be something like call "system" using ws-system-string or something like exec cics start transid("blat") from(ws-blat-param) length(ws-param-length) end-exec or something else entirely. Personally, though, I think this is a terrible solution. It provides very poor error-detection and handling mechanisms, and relies on a black box to provide what might be a crucial feature. (If, on the other hand, this isn't a particularly important feature, then it's probably more trouble than it's worth - particularly the receiving half.) A significantly better option would be to define the requirements properly, then find a library - open-source or vender-supplied - which satisfies them in some way that provides an acceptable balance between ease of use and degree of control. -- Michael Wojcik michael.wojcik@microfocus.com Let's say the conservative is the quiet green grin of the crocodile ... an' the liberal is the SNAP! -- Walt Kelly .