>>Does anyone have any experience sending attachments through MAPI? I am attempting to send files, and when they get to the recipient the file is there, but there is no data in the file. It's a .ZIP file.
>>
>>MSMAPI Session and Message ActiveX controls
>>
>>attachmenttype = 2 The file exists (empty)
>>attachmenttype = 1 Nothing there at all
>>attachmenttype = 0 Embeds the file as text (as expected)
>>
>>
>>Any help would be appreciated.
>>
>>
>>Wayne Myers
>
>
>This is some code that I pulled from an app that works well:
>
>WITH thisform.MAPIMESSAGES
> .SessionID = thisform.MAPISession.SessionID
> .COMPOSE
> .MSGSUBJECT = lcSubject
> .MSGNOTETEXT = lcString
> .ATTACHMENTINDEX = 0
> .ATTACHMENTTYPE = 0
> .ATTACHMENTPOSITION = 0
> .ATTACHMENTPATHNAME = lcMailPath+'EXPORT.ZIP'
> .ATTACHMENTNAME = 'EXPORT.ZIP'
> .SEND(1)
>ENDWITH
>thisform.MAPISESSION.SIGNOFF
>
>
>Hope this helps.
That is the exact code I am using. The only thing is, when I get the .ZIP and look in it, there is nothing there?!?!?
>The one thing that I've not figured out is why after doing this do I have to sign in again to actually send to message and attachment???
If you do the .SEND with 0 instead of 1, it will send the message without prompting you (You have to programatically add the TO: and CC:, etc's to the message). I have also seen that it takes a few seconds for MAPI to actually send the message. It sits in your OutBox until the program does it's next send.
Anyway, thanks for the help, but I guess I will look on MSKB for an article about sending files.
Wayne
Wayne Myers, MCSD
Senior Consultant
Forte' Incorporated
"The only things you can take to heaven are those which you give away" Author Unknown