Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 283
  • Last Modified:

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
0
lewisant
Asked:
lewisant
1 Solution
 
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

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now