Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Mapi error
Message
De
15/03/2007 10:38:25
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
Mapi error
Divers
Thread ID:
01203958
Message ID:
01203958
Vues:
173
Try
   loWSH       = Createobject("wscript.shell")
   cProfile    = loWSH.RegRead([HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\DefaultProfile])
   loWSH       = Null
Catch to oException
   oException  = Null
Endtry

oSession = CreateObject([MAPI.Session])
oSession.Logon(cProfile)

NEW = oSession.OUTBOX.Messages.Add                        && Create a new message.
NEW.SUBJECT = "Test Mail with OLE Messaging"              && Add a message subject.
NEW.Text = "Mail System Test" + Chr(13) + "using OLE!"    && Actual message text.

SENDTO = NEW.RECIPIENTS.Add                               && Add a recipient object
SENDTO.Name="pp@webhiker.dk"                              && Email address to mail message to
SENDTO.Type=1                                             && 1= "TO:"; 2="CC:"; 3="BCC:"

NEW.Update                                                && Required to save changes to a message object.
NEW.Send(1,0,0)                                           && Parameter 1 = save copy in "Sent Mail" folder.
oSession.LOGOFF                                           && Release the MAPI object.
Now, all works well, the message gets saved - except the .Send method throws an exception.

Here is the error message
Error       : 1429
Message     : OLE IDispatch exception code 17389 from Collaboration Data Objects: [Collaboration Data Objects - [E_FAIL(80004005)]]..
I've looked on the internet, but found nothing that would indicate a reason for this particular error.

TIA
Peter Pirker


Whosoever shall not fall by the sword or by famine, shall fall by pestilence, so why bother shaving?

(Woody Allen)
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform