Boa tarde.
O programa abaixo envia email pelo Cobol (AcuCobol) mas não tenho a biblioteca em destaque.
Alguém teria a biblioteca: MSMAPI32.DEF para me fornecer. Pode ser em pvt: pjrsil@uol.com.br
Agradeço retorno.
Pedro Junior
IDENTIFICATION DIVISION.
PROGRAM-ID. OLEMAPI.
ENVIRONMENT DIVISION.
*====================
*
* Copyright (c) 1996-2001 by Acucorp, Inc. Users of ACUCOBOL
* may freely modify and redistribute this program.
*
* This sample demonstrates how to use the Microsoft MAPI OLE Library
* from ACUCOBOL-GT to send emails.
* Note that this example application requires the use of the attached
* definition file, using another definition file for the MAPI object
* may cause the application to fail.
*
* This technique should work with both OutLook and OutLook Express,
* however, there are some requirements. Take a look at these URLs
* if you experience any problems (urls valid as of 14 November 2001)
* http://support.microsoft.com/support/kb/articles/q180/5/05.asp
* http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mapi98/html/vbobjmapis.asp
*
* For an overview of the OLE MAPI object:
* http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mapi98/dt_vbobjMAPIS_C.asp
*
* This sample is provided by Acucorp, Inc. 'as is',
*
*
*====================
SPECIAL-NAMES.
COPY "MSMAPI32.DEF".
.
WORKING-STORAGE SECTION.
77 MYSESSION HANDLE OF MAPISESSION OF MSMAPI.
77 MYMESSAGE HANDLE OF MAPIMESSAGES OF MSMAPI.
77 MYSESSID PIC S9(9) COMP-5.
77 CNTL-FONT USAGE HANDLE OF FONT SMALL-FONT.
77 MY-RECIP-NAME PIC X(255) VALUE SPACE.
77 MY-RECIP-ADDR PIC X(255) VALUE SPACE.
PROCEDURE DIVISION.
MAIN-LOGIC.
DISPLAY STANDARD GRAPHICAL WINDOW
LINES 16
SIZE 30
BACKGROUND-LOW
CONTROL FONT IS CNTL-FONT
CELL HEIGHT 12
CELL WIDTH 12
TITLE
"Microsoft OLE MAPI demonstration".
MOVE "John Doe" TO MY-RECIP-NAME.
MOVE "jdoe@doe.com" TO MY-RECIP-ADDR.
IF MY-RECIP-NAME = SPACE
OR MY-RECIP-ADDR = SPACE
INSPECT MY-RECIP-NAME REPLACING TRAILING
SPACES BY LOW-VALUES
INSPECT MY-RECIP-ADDR REPLACING TRAILING
SPACES BY LOW-VALUES
DISPLAY MESSAGE BOX
"Recipient name and/or address must be set "
X"0A"
"Prior to using this software."
X"0A"
"Please adjust your code and recompile."
X"0A"
X"0A"
"Current name: "
MY-RECIP-NAME
X"0A"
"Current address: "
MY-RECIP-ADDR
TITLE "Incomplete address"
GO TO MAIN-LOGIC-END.
DISPLAY LABEL "Creating the session control..." AT 0101.
CREATE MAPISESSION OF MSMAPI
LICENSE-KEY "mgkgtgnnmnmninigthkgogggvmkhinjggnvm"
HANDLE IN MYSESSION.
DISPLAY LABEL "Creating the message control..." AT 0201.
CREATE MAPIMESSAGES OF MSMAPI
LICENSE-KEY "mgkgtgnnmnmninigthkgogggvmkhinjggnvm"
HANDLE IN MYMESSAGE.
DISPLAY LABEL "Disabling mail download..." AT 0301.
MODIFY MYSESSION DOWNLOADMAIL 0.
DISPLAY LABEL
"Logon the mail engine, using default profile..."
AT 0401.
MODIFY MYSESSION SIGNON().
DISPLAY LABEL "Obtain the session id..." AT 0501.
INQUIRE MYSESSION SESSIONID MYSESSID.
DISPLAY LABEL
"Associate the message with the current session..."
AT 0601.
MODIFY MYMESSAGE SESSIONID = MYSESSID.
DISPLAY LABEL "Prepare a new message..." AT 0701.
MODIFY MYMESSAGE COMPOSE().
DISPLAY LABEL "Set the message subject..." AT 0801.
MODIFY MYMESSAGE MSGSUBJECT =
"This is the subject".
DISPLAY LABEL "Set the message body text..." AT 0901.
MODIFY MYMESSAGE MSGNOTETEXT =
"Hello world from ACUCOBOL-GT using OLE MAPI".
* If you have multiple files, duplicate the MODIFY statement,
* but increment by one for each additional file, like:
* File 1: ATTACHMENTINDEX = 0 ATTACHMENTPOSITION 0
* File 2: ATTACHMENTINDEX = 1 ATTACHMENTPOSITION 1
* and so on
DISPLAY LABEL "Sending an attachment..." AT 1001.
MODIFY MYMESSAGE ATTACHMENTINDEX = 0
ATTACHMENTPOSITION = 0
ATTACHMENTPATHNAME =
"olemapi.cbl".
DISPLAY LABEL "Set recipient 'real' name..." AT 1101.
MODIFY MYMESSAGE RECIPDISPLAYNAME =
MY-RECIP-NAME.
DISPLAY LABEL "Set recipient email address..." AT 1201.
MODIFY MYMESSAGE RECIPADDRESS =
MY-RECIP-ADDR.
DISPLAY LABEL "Send message, no verification dialog..."
AT 1301.
MODIFY MYMESSAGE SEND(0).
DISPLAY LABEL "Log off session..." AT 1401.
MODIFY MYSESSION SIGNOFF().
DISPLAY LABEL "Email transmit done..." AT 1501.
ACCEPT OMITTED AT 1523.
* Clean up
DESTROY MYMESSAGE.
DESTROY MYSESSION.
MAIN-LOGIC-END.
STOP RUN.



