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. C / C++ / MFC
  4. MAPI error MAPI_E_NOT_SUPPORTED problem

MAPI error MAPI_E_NOT_SUPPORTED problem

Scheduled Pinned Locked Moved C / C++ / MFC
helpsysadmincsharpc++visual-studio
11 Posts 3 Posters 21 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.
  • J Offline
    J Offline
    jur2002
    wrote on last edited by
    #1

    Hello everybody! My working environment is: Windows 10, Visual Studio Community 2017 (and 2008 for older projects), programming takes place only in C/C++. I need my program to be able to send emails with a PDF file attachment. The easiest way to send emails is to use ShellExecute with the parameter "mailto:someone@mail.com ... etc". But this method does not allow you to transfer attachments. So I tried using MAPISendMail in a variety of variants found on the internet. Including [Programmatically adding attachments to emails](https://www.codeproject.com/Articles/12757/Programmatically-adding-attachments-to-emails) and many others. Almost all of them work fine on my computer. However, when I trying to send an email on another computer, it leads to an error in the MAPISendMail function MAPI_E_NOT_SUPPORTED (code 26). In this case, the MAPILogon(Ex) function is executed without errors. Both computers, mine and the other, are on the same network and use the same mail server and Outlook as the client for users. On the other computer send/receive of the emails works perfectly. I searched the Internet for a long time for an explanation of this error, but found nothing. A search on the site [CodeProject](www.codeproject.com) also did not give anything. Please explain me what this error means and how to fix it. Thank you very much!

    L V 4 Replies Last reply
    0
    • J jur2002

      Hello everybody! My working environment is: Windows 10, Visual Studio Community 2017 (and 2008 for older projects), programming takes place only in C/C++. I need my program to be able to send emails with a PDF file attachment. The easiest way to send emails is to use ShellExecute with the parameter "mailto:someone@mail.com ... etc". But this method does not allow you to transfer attachments. So I tried using MAPISendMail in a variety of variants found on the internet. Including [Programmatically adding attachments to emails](https://www.codeproject.com/Articles/12757/Programmatically-adding-attachments-to-emails) and many others. Almost all of them work fine on my computer. However, when I trying to send an email on another computer, it leads to an error in the MAPISendMail function MAPI_E_NOT_SUPPORTED (code 26). In this case, the MAPILogon(Ex) function is executed without errors. Both computers, mine and the other, are on the same network and use the same mail server and Outlook as the client for users. On the other computer send/receive of the emails works perfectly. I searched the Internet for a long time for an explanation of this error, but found nothing. A search on the site [CodeProject](www.codeproject.com) also did not give anything. Please explain me what this error means and how to fix it. Thank you very much!

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      You need to examine the code that causes the error. That should give a clue as to why it occurs.

      J 1 Reply Last reply
      0
      • J jur2002

        Hello everybody! My working environment is: Windows 10, Visual Studio Community 2017 (and 2008 for older projects), programming takes place only in C/C++. I need my program to be able to send emails with a PDF file attachment. The easiest way to send emails is to use ShellExecute with the parameter "mailto:someone@mail.com ... etc". But this method does not allow you to transfer attachments. So I tried using MAPISendMail in a variety of variants found on the internet. Including [Programmatically adding attachments to emails](https://www.codeproject.com/Articles/12757/Programmatically-adding-attachments-to-emails) and many others. Almost all of them work fine on my computer. However, when I trying to send an email on another computer, it leads to an error in the MAPISendMail function MAPI_E_NOT_SUPPORTED (code 26). In this case, the MAPILogon(Ex) function is executed without errors. Both computers, mine and the other, are on the same network and use the same mail server and Outlook as the client for users. On the other computer send/receive of the emails works perfectly. I searched the Internet for a long time for an explanation of this error, but found nothing. A search on the site [CodeProject](www.codeproject.com) also did not give anything. Please explain me what this error means and how to fix it. Thank you very much!

        V Offline
        V Offline
        Victor Nijegorodov
        wrote on last edited by
        #3

        We had similar problems (sending e-mails with attachments). But since all our customers use MS Outlook as a standard e-mail application, we just implemented the Outlook automation. So the problem was solved.

        J 1 Reply Last reply
        0
        • L Lost User

          You need to examine the code that causes the error. That should give a clue as to why it occurs.

          J Offline
          J Offline
          jur2002
          wrote on last edited by
          #4

          One of the simplest variants I taked from [Sending Email with MAPI](https://www.experts-exchange.com/articles/1820/Sending-Email-with-MAPI.html), "Attachment" example. It works perfectly on my computer, but cannot send email on other. My send mail code fragment is:

          LHANDLE lhSession;
          ULONG result = lpfnMAPILogOn(0, NULL, NULL, 0, 0, &lhSession);

          ULONG nSent = lpfnMAPISendMail(lhSession, 0, &MAPImsg, MAPI_LOGON_UI | MAPI_DIALOG, 0);

          lpfnMAPILogOff(lhSession, 0, 0, 0);

          Variable result is OK, but nSent is MAPI_E_NOT_SUPPORTED (code 26). Complete example project there: [Probe3.7z - Google Drive](https://drive.google.com/file/d/1KUID\_xwJBdp8MJI8dXS5\_dxAo4DljP0b/view?usp=sharing).

          L 1 Reply Last reply
          0
          • V Victor Nijegorodov

            We had similar problems (sending e-mails with attachments). But since all our customers use MS Outlook as a standard e-mail application, we just implemented the Outlook automation. So the problem was solved.

            J Offline
            J Offline
            jur2002
            wrote on last edited by
            #5

            Unfortunately, we do not use Outlook automation, we just have Microsoft Office installed with the Outlook mail program. In addition, it is important to me that my program can send an email from different computers. And finally I want to understand what's the matter here :-)

            V 1 Reply Last reply
            0
            • J jur2002

              One of the simplest variants I taked from [Sending Email with MAPI](https://www.experts-exchange.com/articles/1820/Sending-Email-with-MAPI.html), "Attachment" example. It works perfectly on my computer, but cannot send email on other. My send mail code fragment is:

              LHANDLE lhSession;
              ULONG result = lpfnMAPILogOn(0, NULL, NULL, 0, 0, &lhSession);

              ULONG nSent = lpfnMAPISendMail(lhSession, 0, &MAPImsg, MAPI_LOGON_UI | MAPI_DIALOG, 0);

              lpfnMAPILogOff(lhSession, 0, 0, 0);

              Variable result is OK, but nSent is MAPI_E_NOT_SUPPORTED (code 26). Complete example project there: [Probe3.7z - Google Drive](https://drive.google.com/file/d/1KUID\_xwJBdp8MJI8dXS5\_dxAo4DljP0b/view?usp=sharing).

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              The issue is that some parameter that is in that SendMail call is incorrect according to the client or server that is handling the request. But there is no way anyone here can tell which it is. You need to capture more information somehow.

              1 Reply Last reply
              0
              • J jur2002

                Hello everybody! My working environment is: Windows 10, Visual Studio Community 2017 (and 2008 for older projects), programming takes place only in C/C++. I need my program to be able to send emails with a PDF file attachment. The easiest way to send emails is to use ShellExecute with the parameter "mailto:someone@mail.com ... etc". But this method does not allow you to transfer attachments. So I tried using MAPISendMail in a variety of variants found on the internet. Including [Programmatically adding attachments to emails](https://www.codeproject.com/Articles/12757/Programmatically-adding-attachments-to-emails) and many others. Almost all of them work fine on my computer. However, when I trying to send an email on another computer, it leads to an error in the MAPISendMail function MAPI_E_NOT_SUPPORTED (code 26). In this case, the MAPILogon(Ex) function is executed without errors. Both computers, mine and the other, are on the same network and use the same mail server and Outlook as the client for users. On the other computer send/receive of the emails works perfectly. I searched the Internet for a long time for an explanation of this error, but found nothing. A search on the site [CodeProject](www.codeproject.com) also did not give anything. Please explain me what this error means and how to fix it. Thank you very much!

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                Hmmm, Have you checked to see if there is a mail client defined? What is the value of the registry key: HKEY_LOCAL_MACHINE\Software\Clients\Mail [Mapi32.dll Stub Registry Settings | Microsoft Docs](https://docs.microsoft.com/en-us/previous-versions/windows/desktop/windowsmapi/mapi32-dll-stub-registry-settings)

                J 1 Reply Last reply
                0
                • J jur2002

                  Unfortunately, we do not use Outlook automation, we just have Microsoft Office installed with the Outlook mail program. In addition, it is important to me that my program can send an email from different computers. And finally I want to understand what's the matter here :-)

                  V Offline
                  V Offline
                  Victor Nijegorodov
                  wrote on last edited by
                  #8

                  It is not a big problem to implement the Outlook automation: about two to three working days (including tests and reading documentation). The only problem I see is some of your customers may use some other (non-Outlook) mail-application, so my suggestion won't work for them.

                  1 Reply Last reply
                  0
                  • L Lost User

                    Hmmm, Have you checked to see if there is a mail client defined? What is the value of the registry key: HKEY_LOCAL_MACHINE\Software\Clients\Mail [Mapi32.dll Stub Registry Settings | Microsoft Docs](https://docs.microsoft.com/en-us/previous-versions/windows/desktop/windowsmapi/mapi32-dll-stub-registry-settings)

                    J Offline
                    J Offline
                    jur2002
                    wrote on last edited by
                    #9

                    I checked the registry keys on both computers (on my working one and on the other one having problems with sending mail programmatically). They match.

                    L 1 Reply Last reply
                    0
                    • J jur2002

                      I checked the registry keys on both computers (on my working one and on the other one having problems with sending mail programmatically). They match.

                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #10

                      Well, I can't think of anything else. You might have to debug this one. You can try [resetting the MAPI settings](https://docs.microsoft.com/en-us/previous-versions/windows/desktop/windowsmapi/installing-or-restoring-the-mapi32-dll-stub) with Fixmapi. I think fixmapi.exe is in the systems32 folder.

                      1 Reply Last reply
                      0
                      • J jur2002

                        Hello everybody! My working environment is: Windows 10, Visual Studio Community 2017 (and 2008 for older projects), programming takes place only in C/C++. I need my program to be able to send emails with a PDF file attachment. The easiest way to send emails is to use ShellExecute with the parameter "mailto:someone@mail.com ... etc". But this method does not allow you to transfer attachments. So I tried using MAPISendMail in a variety of variants found on the internet. Including [Programmatically adding attachments to emails](https://www.codeproject.com/Articles/12757/Programmatically-adding-attachments-to-emails) and many others. Almost all of them work fine on my computer. However, when I trying to send an email on another computer, it leads to an error in the MAPISendMail function MAPI_E_NOT_SUPPORTED (code 26). In this case, the MAPILogon(Ex) function is executed without errors. Both computers, mine and the other, are on the same network and use the same mail server and Outlook as the client for users. On the other computer send/receive of the emails works perfectly. I searched the Internet for a long time for an explanation of this error, but found nothing. A search on the site [CodeProject](www.codeproject.com) also did not give anything. Please explain me what this error means and how to fix it. Thank you very much!

                        L Offline
                        L Offline
                        Lost User
                        wrote on last edited by
                        #11

                        I think you still need to confirm the Outlook and MAPI versions; if you're looking for differences between computers. [Choose a specific version of MAPI to load | Microsoft Docs](https://docs.microsoft.com/en-us/office/client-developer/outlook/mapi/how-to-choose-a-specific-version-of-mapi-to-load)

                        "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

                        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