Skip to main content

Is there anybody who has a sample program to do this.

We wrote a link but sometimes we got the following error:

 

The server returned an exception.

We run version 9 of extend with ACU THIN CLIENT

 

Kind regards,

Is there anybody who has a sample program to do this.

We wrote a link but sometimes we got the following error:

 

The server returned an exception.

We run version 9 of extend with ACU THIN CLIENT

 

Kind regards,

Are you using Lotus notes to call an Acu program - similar to what is described here: community.microfocus.com/.../archive-integration-to-lotus-notes
Or are you using Acu to call Lotus notes?
Which program is attempting to send the email and can you post a bit of code as to how you are doing that. As far as the exception, is the exception happening in the COBOL program running on the server or is the exception happening on the email server. We'll need some more details in order to help further.

Is there anybody who has a sample program to do this.

We wrote a link but sometimes we got the following error:

 

The server returned an exception.

We run version 9 of extend with ACU THIN CLIENT

 

Kind regards,

Good evening (here in Belgium)
We use ACU to send a mail in Lotus Notes. We did something the same with Outlook and that works fine. Now the customer is obliged to change to Lotus Notes. Sometimes it works but most of the time he gets the error. Is there a way to upload the source code?

Kind regards,

Is there anybody who has a sample program to do this.

We wrote a link but sometimes we got the following error:

 

The server returned an exception.

We run version 9 of extend with ACU THIN CLIENT

 

Kind regards,

Select the More link and then Edit and an editor appears which allows you to Insert a file (or zip)


Is there anybody who has a sample program to do this.

We wrote a link but sometimes we got the following error:

 

The server returned an exception.

We run version 9 of extend with ACU THIN CLIENT

 

Kind regards,

IDENTIFICATION DIVISION.
PROGRAM-ID.
BMCLOTUS INITIAL PROGRAM.
AUTHOR.
Michel Boeckx.
DATE-WRITTEN.
11-09-2018.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER.
PC.
OBJECT-COMPUTER.
PC.
SPECIAL-NAMES.
COPY "\\BMC\\BMCDEF-9\\BMCLOTUS.DEF".
.
DATA DIVISION.
WORKING-STORAGE SECTION.
COPY "\\BMC\\BMCDEF-9\\ACUCOBOL.DEF".
COPY "\\BMC\\BMCDEF-9\\ACUGUI.DEF".
COPY "\\BMC\\BMCDEF-9\\CRTVARS.DEF".
77 olNotes HANDLE OF NOTESSESSION.
77 olMaildb HANDLE OF NOTESDATABASE.
77 olNotesDocument HANDLE OF NOTESDOCUMENT.
77 olNotesField HANDLE OF NOTESRICHTEXTITEM.
77 olNotesWorkspace HANDLE OF NOTESUIWORKSPACE.
77 olNotesUIDocument HANDLE OF NOTESUIDOCUMENT.
77 strEmpty PIC X(100).
77 strMailDB PIC X(100).
77 strUsername PIC X(100).
77 strMailserver pic x(100).
01 HEX-0A PIC X(01) VALUE H"0A".
01 MB-RETURN PIC 9(01) VALUE 0.
01 openjn PIC x(01).
01 TEL-1 PIC 9(05) VALUE 0.
01 EMAILBODY PIC X(256) VALUE SPACES.
LINKAGE SECTION.
01 BEDRIJF PIC X(03).
01 ATTACH1 PIC X(64).
01 ATTACH2 PIC X(64).
01 EMAILTO PIC X(50).
01 EMAILCC PIC X(50).
01 EMAILSUB PIC X(64).
PROCEDURE DIVISION USING BEDRIJF ATTACH1 ATTACH2 EMAILTO EMAILCC
EMAILSUB.
Main.
* DISPLAY MESSAGE BOX
* "PDF factuur klaar gezet?" HEX-0A
* "Versturen naar: " EMAILTO
* TYPE MB-YES-NO
* GIVING MB-RETURN
* IF MB-RETURN = MB-NO
* EXIT PROGRAM
* END-IF.
* create link to session
CREATE NOTESSESSION OF LOTUS HANDLE
IN olNotes.

* get username to create databasename
INQUIRE olNotes@USERNAME
IN strUsername.
* MOVE 0 TO TEL-1
* INSPECT strUsername TALLYING TEL-1 FOR CHARACTERS BEFORE " "
* TODO proper solution for getting mail database name
* MailDbName = Left$(UserName, 1) &
* Right$(UserName, (Len(UserName) - InStr(1, UserName, " "))) &
* ".nsf"
STRING "CDoe/O=John Doe.nsf"
* STRING strUsername(1:1) DELIMITED BY SIZE
* strUsername(TEL-1 2:100 - TEL-1) DELIMITED BY " "
* strUsername(3:090) DELIMITED BY " "
* ".nsf" DELIMITED BY SIZE
* open notesdatabase handle
* STRING "CDoe/O=JohnDoe.nsf"
into strMailDB.

MODIFY olNotes@GETDATABASE(null strMailDB)

GIVING olMaildb.
INQUIRE olMaildb@IsOpen() in openjn
* TODO proper solution to check if maildb is already open
* If olMaildb@IsOpen() = FALSE

if openjn = "0"
Modify olMaildb@OPENMAIL()
end-if

* create the damn document
MODIFY olMaildb@CREATEDOCUMENT()
GIVING olNotesDocument.

* don't know what this does but it looks cool
MODIFY olNotesDocument@APPENDITEMVALUE("SendTo" null)
GIVING olNotesField.

* create link to current workspace
CREATE NOTESUIWORKSPACE
OF LOTUS HANDLE
IN olNotesWorkspace.

* insert attachement
MODIFY olNotesDocument@CREATERICHTEXTITEM("Body")
GIVING olNotesField.
MODIFY
olNotesField@EMBEDOBJECT(1454 null ATTACH1).

* insert attachement
* MODIFY olNotesDocument@CREATERICHTEXTITEM("Body")
* GIVING olNotesField.
IF ATTACH2 NOT = SPACES
MODIFY
olNotesField@EMBEDOBJECT(1454 null ATTACH2)
END-IF.



* create new edit document
MODIFY olNotesWorkspace@EDITDOCUMENT(-1 olNotesDocument).

* get handle of the current edit document so it's shown
INQUIRE olNotesWorkspace@CURRENTDOCUMENT()
in olNotesUIDocument.
*
MODIFY olNotesUIDocument
@FIELDSETTEXT("Subject",
EMAILSUB).
MODIFY olNotesUIDocument
@FIELDSETTEXT("EnterSendTo",
EMAILTO).
MODIFY olNotesUIDocument
@FIELDSETTEXT("EnterCopyTo",
EMAILCC).
MODIFY olNotesUIDocument@GOTOFIELD("Body").
* TODO proper solution add some newLines after insert text
IF EMAILSUB(1:5) = "JCB B"
STRING "Geachte leverancier,"
H'0A0A'
"Hierbij ontvangt u onze "
EMAILSUB
H'0A0A'
"Graag uw orderbevestiging p.o. retour."
DELIMITED BY SIZE INTO EMAILBODY
ELSE
STRING "Geachte klant,"
H'0A0A'
"Hierbij ontvangt U uw "
EMAILSUB
DELIMITED BY SIZE INTO EMAILBODY
END-IF
MODIFY olNotesUIDocument
@INSERTTEXT(EMAILBODY).
EXIT PROGRAM.

In the linkage section comes the email parameters.
I hope this is the way to do it.

Kind regards

Is there anybody who has a sample program to do this.

We wrote a link but sometimes we got the following error:

 

The server returned an exception.

We run version 9 of extend with ACU THIN CLIENT

 

Kind regards,

Have you run in debug to see where the exception occurs?


Is there anybody who has a sample program to do this.

We wrote a link but sometimes we got the following error:

 

The server returned an exception.

We run version 9 of extend with ACU THIN CLIENT

 

Kind regards,

Yes, I did and then it works. The strange thing is that only sometimes the error appears. Another strange thing (since yesterday) is that some mails come in one mail. In the calling program we have a grid whith all the invoices that must be mailed for that day. Then 10 mails are oke while the 11 gives the error. Sometimes 23 or more are going good. Yesterday there where 2 invoices mixed together in one mail. So 4 attachments and 2 times the body but only 1 mail adress (of the first invoice) and for the other no mail. That happened twice.

Kind regards,

Is there anybody who has a sample program to do this.

We wrote a link but sometimes we got the following error:

 

The server returned an exception.

We run version 9 of extend with ACU THIN CLIENT

 

Kind regards,

It's difficult when something works in debug but errors when run live. Can you run it normally, and use the FILE_TRACE configuration variable - set it to 1 .. sometimes having a runtime trace helps in an error not occurring .. or the trace helps point to where the error is occurring. I noticed one other thing, which may or may not be an issue, the CREATE statement - CREATE NOTESSESSION OF LOTUS HANDLE IN olNotes.

You may want to try and add FILE-PATH to that Create statement.

CREATE NOTESSESSION OF LOTUS FILE_PATH "mylotus.xml" HANDLE IN olNotes.

FILE-PATH points to an XML file, place the XML file in the runtime bin directory, within that XML file is the Path of where to find the dlls for that assembly.

<?xml version="1.0"?>
<FILE_PATH>@[DISPLAY]:C:\\path-on-client-where dll-resides</FILE_PATH>

Is there anybody who has a sample program to do this.

We wrote a link but sometimes we got the following error:

 

The server returned an exception.

We run version 9 of extend with ACU THIN CLIENT

 

Kind regards,

Oke, I'll modify the program.
I shall install it on friday in the operational environment.
Kind regards,

Is there anybody who has a sample program to do this.

We wrote a link but sometimes we got the following error:

 

The server returned an exception.

We run version 9 of extend with ACU THIN CLIENT

 

Kind regards,

Good morning,

which specific dll do you mean and can it be different for 32 bit and 64 bit clients? Maybe that is the problem because some people haven't had an error at all.

Kind regards,

Is there anybody who has a sample program to do this.

We wrote a link but sometimes we got the following error:

 

The server returned an exception.

We run version 9 of extend with ACU THIN CLIENT

 

Kind regards,

The dll that was used when you used netdefgen to create BMCLOTUS.DEF. Usually the dlls for an app like Lotus are in a certain directory, that's is the PATH that you want to put into the XML file. If there are 32 and 64 bit clients, are there Lotus dlls for 32 and 64 bit? Typically when you have a 32 bit client accessing a 64 bit dll, you will get a Type mismatch type of error, same in the other direction, a 64 bit client accessing 32 bit dll will have a type mismatch error. If your clients are using both 32 bit runtime (or thin client) or 64 bit runtime (or thin client) then the Lotus Notes app needs to provide both as well and your program needs to have the PATH to the appropriate dlls.