General information
Category:
ActiveX controls in VFP
>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
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