[Migrated content. Thread originally posted on 22 September 2006]
I have a program (I believe it is a sample on one of the forum threads) that I am using to send emails with attachments through MSMAPI. This program works great with Outlook Express. However, when attempting to use the program with Outlook, the emails are placed in the Outbox, when they are eventually sent, they are immediately returned as undeliverable. When I look at the email in sent items, there is no "from" name/address. I have tried to log in as the user name/password and this does not help. Outlook is being used without Exchange Server. I have tried researching this on Microsoft's website, but I basically don't understand how MAPI might differ with and without Exchange Server where Outlook is concerned. Any suggestions?Here is my code:
CREATE MAPISESSION OF MSMAPI
LICENSE-KEY "mggthkgogggvmkhinjggnvm"
HANDLE IN MAPISession.
CREATE MAPIMESSAGES OF MSMAPI
LICENSE-KEY"nnmnmninigthkgogggvmkhinjggnvm"
HANDLE IN MAPIMessage.
MODIFY MAPISession DOWNLOADMAIL 0.
MODIFY MAPISession USERNAME= "support@drcanswers.com".
MODIFY MAPISession PASSWORD = "support".
MODIFY MAPISession SIGNON().
INQUIRE MAPISession SESSIONID Session_ID.
MODIFY MAPIMessage SESSIONID = Session_ID.
MODIFY MAPIMessage COMPOSE().
MODIFY MAPIMessage MSGSUBJECT = EMAIL-SUBJECT.
MODIFY MAPIMessage MSGNOTETEXT = EMAIL-MESSAGE.
MOVE 0 TO INDX.
PERFORM VARYING PTR FROM 1 BY 1 UNTIL PTR > 59
IF ATTACHMENT-FILE(PTR) NOT = SPACES
MODIFY MAPIMessage
ATTACHMENTINDEX = INDX
ATTACHMENTPOSITION = INDX
ATTACHMENTPATHNAME = ATTACHMENT-FILE(PTR)
ADD 1 TO INDX
END-IF
END-PERFORM.
MODIFY MAPIMessage RECIPDISPLAYNAME = RECIPIENT-ADDRESS.
MODIFY MAPIMessage RECIPADDRESS = RECIPIENT-ADDRESS.
MODIFY MAPIMessage @SEND(0).
MODIFY MAPISession SIGNOFF().
DESTROY MAPIMessage.
DESTROY MAPISession.



