Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Invalid Recipient Error with OLE MAPI Controls
Message
From
16/08/1999 13:18:55
 
 
To
15/08/1999 16:22:32
Antonio Gubaira
Ingenieria Y Sistemas
Valencia, Venezuela
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00253890
Message ID:
00254130
Views:
24
>I am dealing with OLE MAPI controls in order to add e-mail capabilities to an application. I read KB article ID: Q135755 which describes a step-by-step procedure for sending mail with the use of these controls (MAPISession and MAPIMessages). The code works just fine for me, but I also want to be able to send mail w/attachments to various recipients. Therefore I made the following changes to the code (I never had any experience with this before) which is stored in the Send button´s click event of my email form:
>
>thisform.oleMAPISession.SignOn
>With this.parent.oleMAPIMsg
> .MsgIndex=-1
> .MsgSubject=this.parent.subject.value
> .MsgNoteText=this.parent.msgtxt.value
> .SessionID=this.parent.olemapisession.sessionid
> For I=1 to 3
> .RecipIndex=I
> .RecipType=1
> .RecipDisplayName='Antonio '+str(I)
> Do case
> case I=1
> .RecipAddress='address1@ingesis.net'
> case I=2
> .RecipAddress='address2@cantv.net'
> case I=3
> .RecipAddress='address3@ingesistemas.com'
> Endcase
> Endfor
> .AttachmentPathName="c:\anything.txt"
> .Send
>Endwith
>thisform.oleMAPISession.SignOff
>thisform.release
>
>(Note: As this is just a trial, all the parameters are hardcoded)
>
>
>When my email form is run I get the following error message: "OLE lDispatch exception code 0 from MAPIMessages: Invalid recipient type...". All I am trying to do is to send the message to 3 different recipients of type 1 (primary recipient). Is there some other way to add recipients besides using the RecipIndex property or am I doing something wrong ?
>
>Thanks in Advance

Antonio

in the send event do send(.F.) instead of Send.

Send worked with vfp3 but in 5 they added T, F. check the help.

Mo
Previous
Reply
Map
View

Click here to load this message in the networking platform