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 Help Please!

MAPI Help Please!

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelp
4 Posts 3 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.
  • L Offline
    L Offline
    LizardWiz
    wrote on last edited by
    #1

    When I use the MAPISendMail command with the MAPI_DIALOG flag it brings up the dialog in Outlook (loading mapi32.dll library) and Outlook Express (loading msoe.dll library). If the mail client is closed, the message will send in Outlook Express, but will sit in the outbox of Outlook until the program is opened and the send/receive button is pressed. How can I change this behavior? I can't create a new process of outlook.exe because I do not know if the mail has been sent before killing the process... Help please, last time I submitted this question I only got one response (which unfortunately did not work out). Thank you in advance... ~LizardWiz()

    D S 2 Replies Last reply
    0
    • L LizardWiz

      When I use the MAPISendMail command with the MAPI_DIALOG flag it brings up the dialog in Outlook (loading mapi32.dll library) and Outlook Express (loading msoe.dll library). If the mail client is closed, the message will send in Outlook Express, but will sit in the outbox of Outlook until the program is opened and the send/receive button is pressed. How can I change this behavior? I can't create a new process of outlook.exe because I do not know if the mail has been sent before killing the process... Help please, last time I submitted this question I only got one response (which unfortunately did not work out). Thank you in advance... ~LizardWiz()

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      Can you provide a code snippet of how you are using the mail API?


      A rich person is not the one who has the most, but the one that needs the least.

      L 1 Reply Last reply
      0
      • L LizardWiz

        When I use the MAPISendMail command with the MAPI_DIALOG flag it brings up the dialog in Outlook (loading mapi32.dll library) and Outlook Express (loading msoe.dll library). If the mail client is closed, the message will send in Outlook Express, but will sit in the outbox of Outlook until the program is opened and the send/receive button is pressed. How can I change this behavior? I can't create a new process of outlook.exe because I do not know if the mail has been sent before killing the process... Help please, last time I submitted this question I only got one response (which unfortunately did not work out). Thank you in advance... ~LizardWiz()

        S Offline
        S Offline
        Shog9 0
        wrote on last edited by
        #3

        Essentially, later versions of Outlook are configured to do this, so as to slow the spread of email worms. See: http://support.microsoft.com/?kbid=290499[^] for information on how to alter this (and other security-related) behavior. Note: as far as i'm aware, this does not apply to Extended MAPI, so you may wish to give that a look. Or just tell your users it's for their own good. ;) Z

        no one puts flowers

        on a flower's grave

        1 Reply Last reply
        0
        • D David Crow

          Can you provide a code snippet of how you are using the mail API?


          A rich person is not the one who has the most, but the one that needs the least.

          L Offline
          L Offline
          LizardWiz
          wrote on last edited by
          #4

          This is sort of it, except that I am also attaching a file with a MapiFileDesc structure... LPMAPILOGON lpfnMAPILogon; LPMAPISENDMAIL lpfnMAPISendMail; LPMAPILOGOFF lpfnMAPILogoff; LHANDLE lhSession; HMODULE hMAPILib; MapiRecipDesc sender = { 0, MAPI_ORIG, "anyone", "anyone@anywhere.com", 0, NULL }; MapiRecipDesc recipient = { 0, MAPI_TO, "someone@anywhere.com", NULL, 0, NULL }; MapiMessage message = { 0, "Some subject", "Some message text", NULL, NULL, NULL, 0, NULL, 1, &recipient, 0, NULL }; hMAPILib = LoadLibrary("either MAPI32.DLL or MSOE.DLL depending on MSO or MSOE"); lpfnMAPILogon = (LPMAPILOGON)GetProcAddress(hMAPILib, "MAPILogon"); lpfnMAPISendMail = (LPMAPISENDMAIL)GetProcAddress(hMAPILib, "MAPISendMail"); lpfnMAPILogoff = (LPMAPILOGOFF)GetProcAddress(hMAPILib, "MAPILogoff"); (*lpfnMAPILogon)(0, NULL, NULL, 0, 0, &lhSession); (*lpfnMAPISendMail)(lhSession, 0, &message, MAPI_DIALOG, 0); (*lpfnMAPILogoff)(lhSession, 0, 0, 0); FreeLibrary(hMAPILib); ~LizardWiz()

          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