MAPI and windows 2002

I have an application that sends an email using the MAPI objects within ASP. This works no problem at all on a computer with windows 98 as the operating system. How ever as soon as you try to use the application on a windows 2000 machine an error occurs, and not only that the error is very un help full. I think that it is unable to find out look as the default email. The code is below, this is a little different to normal as the application was created using a web class. basically i would like to know if this is a known problem, or weather there are new objects within windows 2000 that MAPI can use?


SUB MailIt_onclick

 On Error Resume Next

 Dim mpsSession, mpmMessage, objRecipient

 set mpsSession=CreateObject("MAPI.Session")

 mpsSession.Logon("<KENTON@USERNAME></KENTON@USERNAME>")
 IF Err.Number <> 0 THEN
  MSGBOX "ERROR : Problem logging into email account, " & err.description
 ELSE
   set mpmMessage=mpsSession.Outbox.Messages.Add

   mpmMessage.subject= "<KENTON@SUBJECT></KENTON@SUBJECT>"
   mpmMessage.text = message.innertext

   <KENTON@RECIPIENTS></KENTON@RECIPIENTS>

   IF mpmMessage.Recipients.count > 0 THEN
     mpmMessage.Send showDialog=False

     IF Err.Number <> 0 THEN
      MSGBOX "ERROR : Problem sending email, " & err.description
     ELSE
       mpsSession.LogOff  
       SET mpsSession = NOTHING
       SET mpmMessage = NOTHING
       SET objRecipient = NOTHING
       insertmessage.submit
     END IF

   ELSE
     msgbox "There are no email recipients set ! Hit the re-write report button and add them."
     SET mpsSession = NOTHING
     SET mpmMessage = NOTHING
     SET objRecipient = NOTHING  
   END IF

 END IF

END SUB

Many thanks
Anthony Lewis
lewisantAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

yuhaianCommented:
MAPI need a userid can use Outlook. By default, 2000 WWW service run on system as its id. This id cannot run Outlook. A service started as system id cannot access outlook or other MAPI SERVICE.

Here is An easy solution for you. Find an userid can run outlook, e.g. your id. Using this id to run www service.

Here is the step to use YourID to run www service:
1.) Click on start, Settings, Control panel, Administrative Tools, Services;
2.) Right click on WWW service to see its properties
On "Log On" tab, select this account radio button, fill your id an password in. Click OK to exit.
3.) Restart WWW service, and try your asp again.

Good Luck :-)

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Application Servers

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.