• Programatically sending emails via OUtllok XP (XP)

    Home » Forums » AskWoody support » Productivity software by function » MS Outlook and email programs » Programatically sending emails via OUtllok XP (XP)

    Author
    Topic
    #391688

    OL XP has a draconian Object Model guard that pops up an annoying message when another program is trying to send an email programmatically. Isn’t there a way to get around this? I know that the ‘Redemption’ program can do this but I’m fairly certain I remember reading somewhere about how to send emails programatically even with OL XP that will not activate the Object Model Guardian. I believe it had to do with using CDO.

    Thanks in advance

    Viewing 2 reply threads
    Author
    Replies
    • #700476

      Redemption is not a program, it is a COM object that uses Extended MAPI to bypass Outlook security (Extended MAPI is safe because it can’t be scripted). It provides the programmer with the capabilities of Outlook, but without the draconian security imposed. Why re-invent the wheel?

      • #700478

        The reason for staying away from ‘Redemption’ is a cost factor. The need for it would not be just for my company but all the clients that use our product. Have you heard of another approach? Perhaps one using CDO (Collaborative Data Objects)?

        Ed

        • #700483

          I don’t know of a solution using CDO, but I am curious to see if others come up with one.

          (Paying $199.99 for a license for unlimited distribution doesn”t seem very expensive; there is also the free utility ClickYes)

        • #700553

          Ed, I have been wanting to learn about CDO myself, but have not had time. One place to start would be Slipsticks’ CDO page.

        • #700584

          Ed,
          Sample code for CDO would look like:

          Set CDOSession = CreateObject("MAPI.Session")
          CDOSession.Logon "Exchange Profile"
          Set oFolder = CDOSession.Outbox
          Set oMessages = oFolder.Messages
          Set oMsg = oMessages.Add
          Set oRcpt = oMsg.Recipients
          oRcpt.Add , "SMTP:me@here.com", CDOTo
          oRcpt.Resolve
          oMsg.Subject = "Test Message"
          oMsg.Text = "This is a test message..."
          oMsg.Send
          CDOSession.Logoff
          

          A couple of things to note:
          1. Not everyone may have CDO – Office XP does not install it by default.
          2. If you have CDO1.21s it is also susceptible to the Security feature. See Microsoft Knowledge Base Article 295302
          Hope that helps.

          • #700596

            Rory, if you know, where do people using Outlook client find the CDO libraries, help files, etc? Slipstick reads as if it’s a major fishing expedition to assemble all the necessary components.

            • #700730

              John,
              Off the top of my head, I couldn’t tell you – I have the Developer version of Office and Exchange Administrator and it was installed by one of those. I would imagine that if you chose a Run All from Hard Disk installation of Office, it should be included. Failing that, you can probably copy the files from the Office CD and register them yourself with regsvr32.
              Hope that helps.

            • #700737

              CDO was one of the specifed non-default options on my Office XP install disk.

    • #700694

      Hi, I also had this problem when attempting to send emails from another application. The solution I have used is to make OE my default mail app. I still use OL as my main mail ap. Prob not the ideal solution – but it works!!

      Neville Wenban

    • #700722

      Not sure from where you want to send these messages, but I’ve used SMTPSEND on Outlook 2002 in a BATch file. There are a whole raft of programs with the same name; mine is fairly ancient, from 7th Wave Software, but it works! The interface is a bit clunky. I’m not sure if BLAT (via Google) has the problem you speak of…

    Viewing 2 reply threads
    Reply To: Programatically sending emails via OUtllok XP (XP)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: