This message serves for Google indexing. It only includes the first message of each thread from technical forums. To see the entire thread, the solutions and the technical content related to each message, you need to log in by going to the main page. This can be done at http://www.universalthread.com. If you do not have an account, we encourage you to create one now and start participating in Microsoft .NET and SQL Server related technology forums, just to name a few. Our database contains nearly two millions valuable high end technical messages. Thanks for the generous contribution to everyone who participated on the site so far, including MVP, Microsoft employees and many other well known contributors. The valuable content of the Universal Thread has created a history of 16 years of high end technical content which has helped many consultants, developers and many others in the industry on a daily basis. The site also offers a subscription option that greatly enhances your site experience.


View message
From29/07/1997 10:07:27
Brent Sliefert #071023
Epiq Systems
Kansas City, Kansas, United States
To  
All


I have got a couple of MAPI related problems.
1) What is the best resource on MAPI for VFP programmers?
2) On Win95, I need to create a message and send it programmatically (no user intervention).
I run the code below and get 'Invalid Callee' error. If I put .Send(1) it will work fine but
it brings up your mail program.
I also, want to do this on our Web server(NT 4.0 running IIS3.0) as a sort of auto responder.
Again .send will not work but with a different error: OLE lDispatch exception Code 0 from MAPI32:
Unspecified Error. That's real helpful. Another difference is that I can't get the message sent on
the NT box no matter what .send I use (.send .send(1) .send(0) .send(-1) .send(2) ) I tried them all!

Do I need to use the .DLL instead of the .OCX?

The code is below.

Thanks for any help,
Brent
brent.sliefert@usa.net
Human Interface
913-438-8717



With ThisForm.MAPISession
*.UserName = "MS Exchange"
.NewSession = .T.
.DownLoadMail = .F.
.SignOn
If .SessionID <=0
MessageBox("Invalid Session ID Was Generated." + Chr(13) +;
"Unable To Connect To Windows Messaging.", 0, "Error")
RETURN
EndIf
EndWith

With ThisForm.MAPIMessages
.SessionID = ThisForm.MAPISession.SessionID
.Compose
.RecipIndex = 0
.MsgIndex = -1
.RecipType = 1
.RecipDisplayName = "John Doe"
.RecipAddress = "JDoe@xyz.com"
.MsgSubject = "Any Subject"
.AttachmentIndex = 0
.AttachmentPosition = 0
.AttachmentPathName = CurDir() + "ZipFile.zip"
.AttachmentName = "ZipFile.zip"
.Send
EndWith
ThisForm.MAPISession.SignOff