Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error sending mail via MAPI on a win2k Server
Message
From
10/05/2002 14:52:15
 
 
To
10/05/2002 11:27:37
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00654684
Message ID:
00655218
Views:
49
>I just tried this on a W2K Server here (it has Outlook and Visual Studio installed). It fails, with the same error message you have shown, on the createobject() line. Michael's code works fine on that same machine...

Steve,

Based on what you said, I adapted Michael's code (see below) and put it to work in the server. It worked fine, but Outlook said that "someone was trying to send a mail message" (or something like that) and asked me for an ok... My client's software support guy was with me during the test and told me that this was because it was an Outlook XP version (???), but he would make some arrangements later...

The odissey will continue thought... <s>

Thanks to you and Michael!

Fernando
 oleMAPISession = CreateObject ("MSMAPI.MAPISession.1")

 With oleMAPISession
 
    .LogonUI  = .T.              <<<<  This has been changed from .F. to .T.
    .UserName = cSenderProfile   <<<<  The MAPI profile was used
    .Password = ""

    .Signon()

    If .SessionID <= 0
       Error  <<<<
       Return <<<<
    endif
       
    oleMAPIMessages = CreateObject  ("MSMAPI.MAPIMessages.1")

    oleMAPIMessages.SessionID = .SessionID

 EndWith

 oleMAPIMessages.Compose ()

 oleMAPIMessages.MsgSubject  = cMessageSubject
 oleMAPIMessages.MsgNoteText = cMessageText

 For nRecips = 1 To nRecipCount

     oleMAPIMessages.RecipIndex       =               nRecips - 1   <<<<  Had to add this
     oleMAPIMessages.RecipDisplayName = TabRecipInfo [nRecips]      <<<<  For multiple recipients
     oleMAPIMessages.RecipType        = 1
    
     oleMAPIMessages.ResolveName ()   

 EndFor
 
 oleMAPIMessages.Send   (.F.)
 oleMAPISession.Signoff ()
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform