objSession = CreateObject ("MAPI.Session") objSession.Logon (cSenderProfile, 0, 0, 1) objMessage = objSession.Outbox.Messages.Add objMessage.Subject = cMessageSubject objMessage.Text = cMessageText For nRecips = 1 To nRecipCount objRecip = objMessage.Recipients.Add objRecip.Name = TabRecipInfo [nRecips] && Array containing recipients objRecip.Type = 1 && TO objRecip.Resolve EndFor objMessage.Update objMessage.Send objSession.LogoffThat code was based in: HOWTO: Use OLE Messaging to Send Mail in Visual FoxPro App - ID: Q146641, from the Microsoft Knowledge base (see below).
*==== Beginning of OLE Messaging Program. SESSION=CREATEOBJECT('mapi.session') && Create the MAPI object. SESSION.LOGON && Logon to mail; With exchange it && will prompt for a profile. NEW=SESSION.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="myemailaddr" && Email address to mail message to SENDTO.TYPE=1 && 1= "TO:"; 2="CC:"; 3="BCC:" SENDTO.RESOLVE && Looks up address in addressbook. NEW.UPDATE && Required to save changes to a message object. NEW.SEND(1,0,0) && Parameter 1 = save copy in "Sent Mail" folder. SESSION.LOGOFF && Release the MAPI object. *====End of OLE Messaging Program.I wonder what's different from my PC and the win2k Server?