General information
Category:
Windows API functions
Hi Wayne,
I was looking for info on how to send a file via email using MAPI in VFP 5.0 and I came across this thread. I was able to get Outlook to open using the code below, but I get errors from the ole if I try to use .SEND(0) instead of .SEND(1). (I want to be able to specify in my program the recipient etc. I did set a .RecipAddress value, but nothing else).
Also, even when I used .SEND(0), after I clicked on send in Outlook, I again got an OLE error message, even though the email went through and I received the file and message fine.
Any ideas? Where is some good documentation on MAPI anyway? -Rick
>>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
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only