Image not shown in mail (outlook)

adita

New Member
hello,

nice..But i have another problem. when i sent to the outlook the bold and color is show but the image i have insert not show... can you help me.. sorry my english not good. thx:D

the source code:

DEFINE INPUT PARAMETER vchTo AS CHAR NO-UNDO.
DEFINE INPUT PARAMETER vchAttachment AS CHAR NO-UNDO.
DEFINE INPUT PARAMETER vchSubject AS CHAR NO-UNDO.
DEFINE INPUT PARAMETER ccto AS CHAR NO-UNDO.
DEFINE INPUT PARAMETER bccto AS CHAR NO-UNDO.
DEFINE OUTPUT PARAMETER output-nr AS INTEGER NO-UNDO.
DEFINE VARIABLE chOutlook AS COM-HANDLE. /*Outlook com-handle*/
DEFINE VARIABLE chMessage AS COM-HANDLE. /*Message com-handle*/
DEFINE VARIABLE chattach AS COM-HANDLE.
DEFINE VARIABLE chcolfield AS COM-HANDLE.
DEF VAR chfield AS COM-HANDLE.
DEFINE VARIABLE chAttachment AS COM-HANDLE. /*Attachment com-handle*/
DEFINE VARIABLE att-exists AS INTEGER INITIAL 0.
DEFINE VARIABLE i AS INTEGER INITIAL 0.
DEFINE VARIABLE r AS INTEGER INITIAL 0.
CREATE "Outlook.Application" chOutlook.

INPUT STREAM s1 FROM
VALUE(SUBSTR(inpFile2, 1, LENGTH(inpFile2) - 4) + ".html"). /**to put html file become string**/
REPEAT:
IMPORT STREAM s1 UNFORMATTED strxx.
strx1 = strx1 + strxx .
END.

INPUT STREAM s1 CLOSE.
ASSIGN chMessage = chOutlook:CreateItem(0)
chMessage:TO = vchTo
chMessage:cc = ccto
chMessage:bcc = bccto
chMessage:Subject = vchSubject
chmessage:bodyformat = 2
chmessage:htmlBody = strx1.

IF vchAttachment <> "" THEN
DO:
chAttachment = chMessage:attachments. /*get the attachment com-handle*/
DO i = 1 TO NUM-ENTRIES(vchAttachment, ","):
att-exists = chAttachment:ADD(ENTRY(i, vchAttachment, ",")) NO-ERROR . /*add the attachment*/
IF att-exists = ? THEN
DO:
HIDE MESSAGE NO-PAUSE.
MESSAGE "Attachment doesn't exist." VIEW-AS ALERT-BOX INFORMATION.
APPLY "entry" TO fatch IN FRAME fmain.
RETURN NO-APPLY.
END.
END.
END.
output-nr = chMessage:SEND.

/*release the Outlook com-handles*/
RELEASE OBJECT chMessage NO-ERROR.
RELEASE OBJECT chOutlook NO-ERROR.
RELEASE OBJECT chAttachment NO-ERROR.
 
Back
Top