Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Invalid Recipient Type with OLE MAPI Controls
Message
From
15/08/1999 16:26:31
Antonio Gubaira
Ingenieria Y Sistemas
Valencia, Venezuela
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
Invalid Recipient Type with OLE MAPI Controls
Miscellaneous
Thread ID:
00253892
Message ID:
00253892
Views:
393
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:

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

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
Thanks in Advanced or Hope This Helps
Reply
Map
View

Click here to load this message in the networking platform