project BLF > class Mail > method AddAttachment

Description

This method can be used to add attachment in "memptr" data type. The attachments are added to the mail message when the send method is executed. This method does not send any mail on itself!
This method should be called in the same "open instance communication" than the send method.


Parameters


imAttachmentinputmemptrMemory pointer to the attachment.

Use following construction to get a memory pointer for a certain file :

FILE-INFO:FILE-NAME = "c:\temp\test.ppt".
SET-SIZE(vmFile) = FILE-INFO:FILE-SIZE.

INPUT FROM value("c:\temp\test.ppt") BINARY NO-CONVERT.
IMPORT vmFile.
INPUT CLOSE.
icAttachmentNameinputcharacterName of the attachment
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


unused


program code (program1/mail.p)

do viCnt = 1 to 50 :
    if get-size(vmAttachmentStore[viCnt]) = 0
    then do :
        assign vcAttachmentStore[viCnt] = icAttachmentName
               vmAttachmentStore[viCnt] = imAttachment.
        leave.
    end.
end.