Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. MAPI

MAPI

Scheduled Pinned Locked Moved Visual Basic
windows-adminalgorithmshelpquestion
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    cj4331
    wrote on last edited by
    #1

    I'm going to try to make this simple. I use thunderbird as my email client on my pc. I have written a program that uses MAPI to send a message. I need to test it with Outlook. I set up an email account in outlook that works nicely. I then set the default email client to outlook. But, my program still launches thunderbird. Thunderbird tells me it isn't the default email client and mailto: now uses outlook so I know the default email client has been changed to outlook. It's not my code as in windows explorer if I select a file then right click and select Sendto/Mail recipient it still opens thunderbird too. I've been searching the web for over a day now and I've read all kinds of stuff about mapi but can't figure out what is going wrong. It appears the mapistub.dll has replaced mapi32.dll as they are the same size and dates. I think this is normal. There is no mapi32x.dll on my system anywhere. In the registry the default mail client is set to Microsoft Outlook outlook's dllpath is mapi32.dll thunderbird's dllpath is c:\progra~1\mozill~2\mozmapi32.dll I am running Windows XP Pro 2002 SP2, Outlook 2000 Sr-1, Thunderbird 1.5.0.2 I'm hoping someone here can help. Thanks

    D 1 Reply Last reply
    0
    • C cj4331

      I'm going to try to make this simple. I use thunderbird as my email client on my pc. I have written a program that uses MAPI to send a message. I need to test it with Outlook. I set up an email account in outlook that works nicely. I then set the default email client to outlook. But, my program still launches thunderbird. Thunderbird tells me it isn't the default email client and mailto: now uses outlook so I know the default email client has been changed to outlook. It's not my code as in windows explorer if I select a file then right click and select Sendto/Mail recipient it still opens thunderbird too. I've been searching the web for over a day now and I've read all kinds of stuff about mapi but can't figure out what is going wrong. It appears the mapistub.dll has replaced mapi32.dll as they are the same size and dates. I think this is normal. There is no mapi32x.dll on my system anywhere. In the registry the default mail client is set to Microsoft Outlook outlook's dllpath is mapi32.dll thunderbird's dllpath is c:\progra~1\mozill~2\mozmapi32.dll I am running Windows XP Pro 2002 SP2, Outlook 2000 Sr-1, Thunderbird 1.5.0.2 I'm hoping someone here can help. Thanks

      D Offline
      D Offline
      Dave Bacher
      wrote on last edited by
      #2

      The "default mail program" does not impact MAPI -- it is a user setting, while MAPI provider is, unfortunately, a system setting. First, see if System.Web.Mail will get the job done for you -- if it will do what you need, use it. I have not used it with Thunderbird, so I don't know if it will call through. If System.Web.Mail won't get the job done, then try Collaboration Data Objects (CDO), and verify it won't get the job done. If CDO works, it will be a better choice than MAPI. It gives you an object model, etc. and doesn't require nasty p/Invoke calls. The MAPI32.DLL switch operates based on these registry keys (source: Platform SDK) HKEY_LOCAL_MACHINE\Software\Clients\Mail\(default) HKEY_LOCAL_MACHINE\Software\Clients\Mail\Provider1 HKEY_LOCAL_MACHINE\Software\Clients\Mail\Provider2 HKEY_LOCAL_MACHINE\Software\Clients\Mail\Provider3 Where Provider1, Provider2 and Provider3 are MAPI providers. Underneath each provider, find the following: (default) -- this is the display/text name of the provider DLLPath -- this is the file name (without a path) of the DLL DLLPathEx -- this should be the fully qualified path MSI* -- information to do the install Also check for these registry entries, which can overide the MAPI used for specific applications: HKLM\Software\Microsoft\Windows Messaging Subsystem\MSMapiApps::exchng32.exe = "" (route call directly to Mapi32x.dll) HKLM\Software\Microsoft\Windows Messaging Subsystem\MSMapiApps::msspc32.dll = "Microsoft Outlook" (route call using Microsoft Outlook key under HKLM\Software\Clients\Mail) Also, try this (from platform SDK): In the event that an application overwrites Mapi32.dll, you can restore it using Fixmapi.exe. Fixmapi.exe can be found in the same location as the stub library itself, usually C:\Winnt\System32 for Microsoft Windows NT version 4.0 systems. This utility copies the current Mapi32.dll (the new DLL that overwrote the stub library) to Mapi32x.DLL, and then copies the stub image, contained in the Mapistub.dll file, to Mapi32.dll. There are no arguments for Fixmapi.exe. If the MAPI DLL was provided by Netscape or Eudora e-mail clients, the DLL is renamed to Nsmapi.dll or Eumapi.dll respectively, and the appropriate HKLM\Software\Clients\Mail subkey and DLLPath value are created. The DLLPath value points to the renamed DLL because neither DLL supports extended MAPI calls, so the DLLPathEx value is not needed. Again, if at all possible I would go with System.Web.Mail or CDO. These should "do the right thing" an

      C 3 Replies Last reply
      0
      • D Dave Bacher

        The "default mail program" does not impact MAPI -- it is a user setting, while MAPI provider is, unfortunately, a system setting. First, see if System.Web.Mail will get the job done for you -- if it will do what you need, use it. I have not used it with Thunderbird, so I don't know if it will call through. If System.Web.Mail won't get the job done, then try Collaboration Data Objects (CDO), and verify it won't get the job done. If CDO works, it will be a better choice than MAPI. It gives you an object model, etc. and doesn't require nasty p/Invoke calls. The MAPI32.DLL switch operates based on these registry keys (source: Platform SDK) HKEY_LOCAL_MACHINE\Software\Clients\Mail\(default) HKEY_LOCAL_MACHINE\Software\Clients\Mail\Provider1 HKEY_LOCAL_MACHINE\Software\Clients\Mail\Provider2 HKEY_LOCAL_MACHINE\Software\Clients\Mail\Provider3 Where Provider1, Provider2 and Provider3 are MAPI providers. Underneath each provider, find the following: (default) -- this is the display/text name of the provider DLLPath -- this is the file name (without a path) of the DLL DLLPathEx -- this should be the fully qualified path MSI* -- information to do the install Also check for these registry entries, which can overide the MAPI used for specific applications: HKLM\Software\Microsoft\Windows Messaging Subsystem\MSMapiApps::exchng32.exe = "" (route call directly to Mapi32x.dll) HKLM\Software\Microsoft\Windows Messaging Subsystem\MSMapiApps::msspc32.dll = "Microsoft Outlook" (route call using Microsoft Outlook key under HKLM\Software\Clients\Mail) Also, try this (from platform SDK): In the event that an application overwrites Mapi32.dll, you can restore it using Fixmapi.exe. Fixmapi.exe can be found in the same location as the stub library itself, usually C:\Winnt\System32 for Microsoft Windows NT version 4.0 systems. This utility copies the current Mapi32.dll (the new DLL that overwrote the stub library) to Mapi32x.DLL, and then copies the stub image, contained in the Mapistub.dll file, to Mapi32.dll. There are no arguments for Fixmapi.exe. If the MAPI DLL was provided by Netscape or Eudora e-mail clients, the DLL is renamed to Nsmapi.dll or Eumapi.dll respectively, and the appropriate HKLM\Software\Clients\Mail subkey and DLLPath value are created. The DLLPath value points to the renamed DLL because neither DLL supports extended MAPI calls, so the DLLPathEx value is not needed. Again, if at all possible I would go with System.Web.Mail or CDO. These should "do the right thing" an

        C Offline
        C Offline
        cj4331
        wrote on last edited by
        #3

        First, my understanding is that system web mail does not actually open your default mail client but sends the message itself. I'm not sure about CDO. I'm trying to replicate the action of the Send To/Mail Recipient found in Windows Explorer. It's what we want. As for my MAPI setup everything you spoke of looks correct still it doesn't work.

        1 Reply Last reply
        0
        • D Dave Bacher

          The "default mail program" does not impact MAPI -- it is a user setting, while MAPI provider is, unfortunately, a system setting. First, see if System.Web.Mail will get the job done for you -- if it will do what you need, use it. I have not used it with Thunderbird, so I don't know if it will call through. If System.Web.Mail won't get the job done, then try Collaboration Data Objects (CDO), and verify it won't get the job done. If CDO works, it will be a better choice than MAPI. It gives you an object model, etc. and doesn't require nasty p/Invoke calls. The MAPI32.DLL switch operates based on these registry keys (source: Platform SDK) HKEY_LOCAL_MACHINE\Software\Clients\Mail\(default) HKEY_LOCAL_MACHINE\Software\Clients\Mail\Provider1 HKEY_LOCAL_MACHINE\Software\Clients\Mail\Provider2 HKEY_LOCAL_MACHINE\Software\Clients\Mail\Provider3 Where Provider1, Provider2 and Provider3 are MAPI providers. Underneath each provider, find the following: (default) -- this is the display/text name of the provider DLLPath -- this is the file name (without a path) of the DLL DLLPathEx -- this should be the fully qualified path MSI* -- information to do the install Also check for these registry entries, which can overide the MAPI used for specific applications: HKLM\Software\Microsoft\Windows Messaging Subsystem\MSMapiApps::exchng32.exe = "" (route call directly to Mapi32x.dll) HKLM\Software\Microsoft\Windows Messaging Subsystem\MSMapiApps::msspc32.dll = "Microsoft Outlook" (route call using Microsoft Outlook key under HKLM\Software\Clients\Mail) Also, try this (from platform SDK): In the event that an application overwrites Mapi32.dll, you can restore it using Fixmapi.exe. Fixmapi.exe can be found in the same location as the stub library itself, usually C:\Winnt\System32 for Microsoft Windows NT version 4.0 systems. This utility copies the current Mapi32.dll (the new DLL that overwrote the stub library) to Mapi32x.DLL, and then copies the stub image, contained in the Mapistub.dll file, to Mapi32.dll. There are no arguments for Fixmapi.exe. If the MAPI DLL was provided by Netscape or Eudora e-mail clients, the DLL is renamed to Nsmapi.dll or Eumapi.dll respectively, and the appropriate HKLM\Software\Clients\Mail subkey and DLLPath value are created. The DLLPath value points to the renamed DLL because neither DLL supports extended MAPI calls, so the DLLPathEx value is not needed. Again, if at all possible I would go with System.Web.Mail or CDO. These should "do the right thing" an

          C Offline
          C Offline
          cj4331
          wrote on last edited by
          #4

          Well, I tried uninstalling and reinstalling and recreating the accounts in Outlook and I still can't get Outlook to come up when I select Send To/Mail Recipient. Let make this even simplier. Just get me that. I don't want to program anything any more. I want to make Send To/Mail Recipient bring up Outlook. Can anyone tell me how?

          1 Reply Last reply
          0
          • D Dave Bacher

            The "default mail program" does not impact MAPI -- it is a user setting, while MAPI provider is, unfortunately, a system setting. First, see if System.Web.Mail will get the job done for you -- if it will do what you need, use it. I have not used it with Thunderbird, so I don't know if it will call through. If System.Web.Mail won't get the job done, then try Collaboration Data Objects (CDO), and verify it won't get the job done. If CDO works, it will be a better choice than MAPI. It gives you an object model, etc. and doesn't require nasty p/Invoke calls. The MAPI32.DLL switch operates based on these registry keys (source: Platform SDK) HKEY_LOCAL_MACHINE\Software\Clients\Mail\(default) HKEY_LOCAL_MACHINE\Software\Clients\Mail\Provider1 HKEY_LOCAL_MACHINE\Software\Clients\Mail\Provider2 HKEY_LOCAL_MACHINE\Software\Clients\Mail\Provider3 Where Provider1, Provider2 and Provider3 are MAPI providers. Underneath each provider, find the following: (default) -- this is the display/text name of the provider DLLPath -- this is the file name (without a path) of the DLL DLLPathEx -- this should be the fully qualified path MSI* -- information to do the install Also check for these registry entries, which can overide the MAPI used for specific applications: HKLM\Software\Microsoft\Windows Messaging Subsystem\MSMapiApps::exchng32.exe = "" (route call directly to Mapi32x.dll) HKLM\Software\Microsoft\Windows Messaging Subsystem\MSMapiApps::msspc32.dll = "Microsoft Outlook" (route call using Microsoft Outlook key under HKLM\Software\Clients\Mail) Also, try this (from platform SDK): In the event that an application overwrites Mapi32.dll, you can restore it using Fixmapi.exe. Fixmapi.exe can be found in the same location as the stub library itself, usually C:\Winnt\System32 for Microsoft Windows NT version 4.0 systems. This utility copies the current Mapi32.dll (the new DLL that overwrote the stub library) to Mapi32x.DLL, and then copies the stub image, contained in the Mapistub.dll file, to Mapi32.dll. There are no arguments for Fixmapi.exe. If the MAPI DLL was provided by Netscape or Eudora e-mail clients, the DLL is renamed to Nsmapi.dll or Eumapi.dll respectively, and the appropriate HKLM\Software\Clients\Mail subkey and DLLPath value are created. The DLLPath value points to the renamed DLL because neither DLL supports extended MAPI calls, so the DLLPathEx value is not needed. Again, if at all possible I would go with System.Web.Mail or CDO. These should "do the right thing" an

            C Offline
            C Offline
            cj4331
            wrote on last edited by
            #5

            Dave Bacher wrote:

            The "default mail program" does not impact MAPI -- it is a user setting, while MAPI provider is, unfortunately, a system setting.

            Apparently it does. I'd tried changing the default mail program using use Start/Settings/Control Panel/Internet Options many times and it didn't work. But after I used the "Set Program Access and Defaults" icon, located in the Start menu somewhere and in the "Add or Remove Programs" tool in Control Panel to set the default mail program to--as Outlook wasn't an option--Outlook Express things started working. Now using Start/Settings/Control Panel/Internet Options I can change my "default mail program" and the mail program launched by my vb program via mapi changes as does the mail program launched by Send To/Mail recipient in windows explorer. I haven't been in "Set Program Access and Defaults" since. Just use Start/Settings/Control Panel/Internet Options. I've changed it from Outlook to Thunderbird and back several times w/o rebooting or even closing my application and whatever I select as my default mail program is the mail program that is started when I click the button to send mail in my program. Why this works and why it wasn't I don't know but my experiences clearly show changing the default mail program in Start/Settings/Control Panel/Internet Options will change the mail program started by mapi (at least as it is used in my sub). Further my experiences strongly suggest that microsoft uses mapi the same way as I do in their windows explorer send to/mail recipient functionality. Anyway, thanks for the help and I'm working good now.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups