netxmapi examples tested with visual Cobol 5.0

i wanted test the email sending on visual Cobol. I know at the base the example was written in netexpress 5.x

I missed MF-Copy files as:





wintypes.cpy (in MF-Files fail the Definition of lphandle)


Are there other files to be placed in source programs?

Using the netexpress copy files in visual Cobol gives any error on the Syntax!

I can posted this in a separate message!

  • You can use the Net Express copybooks in Visual COBOL but you will have to add the following directive to the project:


    This is a new reserved word in VC and later versions of NX so it cannot be used as a data-name. The REMOVE directive removes it from the reserved word list.

  • Chris, thanks for the remove directive.
    The netxmapi have never work correctly, there are too much bugs in the program, null terminate must be done on the fields (also filename for attachments) and not on the first space. There is not possible to use many recipients (to), not cc and not Bcc.
    Sorry to publish this in the Forum and we hope a Little bit more help and examples that works! This program don't work with the latest Version of netexpress 5.1 as you have inform us. Please send us or publish the working Version/Project! Thanks
  • In the opening comments in the email.cbl program it clearly states the following:

         "The demonstration consists of a simple GUI e-mail application which can be used to send e-mails with attachments. It is intended to be a demonstration only and not a fully functional application. "

    This is a demo and not an email application that you can tailor to your own needs. It is not even distributed with the products. You are expected to take this as an example when writing your own application.

    This demo was written in 1998 by one of our developers. I updated it slightly in 2001.
    It works perfectly for me with the exception that the CC field was never implemented.

    The fields are being null terminated correctly. It is not placing a NULL in the first space but it is placing a NULL in the space following the last character of each field. It uses reference modification to test when the rest of the field = spaces:
             perform varying wx-sub1 from 1 by 1
                  until wx-sub1 > length of wl-profile-name
                  if wl-profile-name(wx-sub1:) = spaces
                        move x"00" to wl-profile-name(wx-sub1:1)
                        exit perform

    I took about 10 minutes here and implemented the CC field functionality for you. I am attaching the 2 files that were changed. That is all that I intend to do with this example. 

    Perhaps somebody else has a different example that they can share with you.
  • i will test your program tomorrow, but the mail-to, mail-cc, mail-bcc, mail-subject, mail-text and attachment must be x'00' terminated. You Routine copied from the example do only a x'00' on the first spaces and Exit. I have debug the example and found any thick bugs and have completed and corrected the program. The only Point to solve is the attachment(s)
  • Chris, you example allow to send only to "mail-to" or to "mail-bc". It is and must be possible to send one message with on Windows with many recipients for "Mail-To", many recipients for "Mail-BC" and many recipients for "Mail-BCC", and also many attachments, in the example it was limited to 10. This program crashes only with 1 attachments. Mail-BCC is value 3.

    Mail-to:;; xyz@microfocus.comx'00'
    Mail-BCC:; michi@disneyland.frx'00'
    Subject: this is a test messagex'00'
    Message text: i have send a test message to any mail-to addresses, any mail-bc addresses, mail-bcc addresses and any attachments.x'00'
    this is a ASCII-file.asc
    this is a cs-file.csv
    this is a word-file.docx
    this is a Excel-file.xlsx

    I have include with a new keyin field the bcc