[Migrated content. Thread originally posted on 18 August 2006]
I have this subroutine written in AcuCOBOL that sends emails with attachments.Its using the Simple MAPI calls available in MAPI.DLL
It works just fine.
I can send email versions of all reports that are generated in my applications.
I can send A/R Statements to Customers.
I can send Bulk Email to all A/R Customers and all A/P Vendors
I can send Invoices from my Invoice system
It is a very useful routine.
It is set up to handle up to 3 attachments.
Up till recently, the recipients of the emails have always been using Outlook, and they have always been able to correctly open any attachments sent as Word or Excel documents.
Now the problem ???????
It seems that if the recipient is using Lotus Notes as their email client, the attachments cannot be opened.
The attachments are being renamed to WINMAIL.DAT and are being decoded incorrectly.
I know this may not be directly be an Acucobol problem, but I?m running out of options in figuring out how this is supposed to be coded properly.
I?ve spent hours scanning the MSDN web site reading through documentation on Simple MAPI.
I believe the problem is related to the use of the packets used to define the attachments.
I need to be able to specify the Type of Attachment and it?s Encoding by populating the following structures:
* ----------------------------------------------
* The [MapiFileDesc] structure contains information about file(s) containing a message attachment stored as a temporary file.
* The file can contain a static or embedded OLE object, an embedded message, or other types of files.
* Up to 3 attachments may be defined
*
* MAPI C original struct
* typedef struct {
* ULONG ulReserved; - Must be ZERO
* ULONG flFlags; - set MAPI_OLE and/or MAPI_OLE_STATIC as an embedded or static OLE Object
* ULONG nPosition; - An integer indicating the position in the message that the attachment is placed
* A value of -1 a position is not indicated.
* LPTSTR lpszPathName; - Pointer to text string containing the fully qualified path to attatched file.
* LPTSTR lpszFileName; - Pointer to attachment filename as seen by the recipient. (It may differ of may be NULL)
* LPVOID lpFileType; - Pointer to attachment file type MapiFileTagExt structure.
* NULL indicates an unknown file type or a type to be determined by op system.
* } MapiFileDesc, FAR *lpMapiFileDesc;
*
And ?..
* ----------------------------------------------
* The [MapiFileTagExt] structure specifies a message attachment's type at it's creation and it's current form of encoding
* so it can be restored to it's original type at its destination.
*
* MAPI C original struct
* typedef struct {
* ULONG ulReserved; - Must be ZERO
* ULONG cbTag; - the size in bytes of the value defined by lpTag
* LPBYTE lpTag; - Pointer to an X.400 object identifier indicating type of attachment in its original form
* ULONG cbEncoding; - the size in bytes of the value defined by lpEncoding
* LPBYTE lpEncoding; - Pointer to an X.400 object identifier indicating the form which the attachment is encoded
* } MapiFileTagExt, FAR *lpMapiFileTagExt;
*
In particular, I?m trying to find out how to set up the lpTag and lpEncoding identifiers.
In my program now I have the lpTag pointing to a working storage that contains the following:
01 TAG-FILE-TYPE PIC X(35) VALUE '?Microsoft Excel worksheet"'.
And the lpEncoding pointing to working storages that contains the following:
01 ENCODING-TYPE PIC X(10) VALUE "binary".
I?m really not sure if these are the values that are supposed to be set as I cannot find documentation on the X.400 object identifiers as to what are valid types of attachments and encoding methods.
I've tried Binary and Base64 but both get the same result.
=======================================================
This is a long shot trying this Customer Forum.
I hope it works.
========================================================



