Results 1 to 7 of 7

Thread: [2005] CDO or PIA?

  1. #1

    Thread Starter
    Frenzied Member circuits2's Avatar
    Join Date
    Sep 2006
    Location
    Kansas City, MO
    Posts
    1,027

    [2005] CDO or PIA?

    I have an application that requires an email alert to be sent to specific corporate users when the proper conditions exist.

    Environment:
    Corporate enterprise network
    Exchange Server
    MS Office 2003
    Over 14,000 users in AD
    VERY tight security

    My application is installed with full-trust privileges.

    Would it be best to use CDO (Collaboration Data Objects) to send information directly through Exchange?

    Or should I use PIA (Primary Interop Assemblies) to automate MS Outlook?

    Keep in mind that the action needs to be transparent to the user (i.e. If using outlook, I don't want to desensitize users to security issues by constantly exposing them to email warnings.).
    Show the love! Click (rate this post) under my name if I was helpful.

    My CodeBank Submissions: How to create a User Control | Move a form between Multiple Monitors (Screens) | Remove the MDI Client Border | Using Report Viewer with Visual Studio 2012 Express

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: [2005] CDO or PIA?

    To do it transparently with a PIA would mean that you would need to support multiple versions of outlook or change the code/compile when Outlook is eventually upgraded. With CDO you will still be subject to certain security restrictions as its not a 100% bypass. Have you considered using the mail class in .NET?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: [2005] CDO or PIA?

    I'm with RD on this... go with option C - use the Mail class built right into .NET.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  4. #4

    Thread Starter
    Frenzied Member circuits2's Avatar
    Join Date
    Sep 2006
    Location
    Kansas City, MO
    Posts
    1,027

    Re: [2005] CDO or PIA?

    By "Mail class" do you mean System.Net.Mail? If so, I thought about that but I had a hard time finding examples for Exchange server. As I'm looking at the documentation, I only see references to SMTP. Can you use System.Net.Mail with Exchange?
    Show the love! Click (rate this post) under my name if I was helpful.

    My CodeBank Submissions: How to create a User Control | Move a form between Multiple Monitors (Screens) | Remove the MDI Client Border | Using Report Viewer with Visual Studio 2012 Express

  5. #5
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: [2005] CDO or PIA?

    If smtp is turned on... which is should be. I ran a test months ago to see how it worked and didn't have any issues...

    The trick is making sure the right LogonCredentials is sent.


    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  6. #6

    Thread Starter
    Frenzied Member circuits2's Avatar
    Join Date
    Sep 2006
    Location
    Kansas City, MO
    Posts
    1,027

    Re: [2005] CDO or PIA?

    Ok, so since we determined that System.Net.Mail is the way to go, I have another question. Using System.Net.Mail is pretty straightforward. However, is it possible to access the current account that is configured in Outlook to obtain the outgoing mail server for non-Exchange clients? Also, is it just me or does the PIA documentation seem to be less thorough than everything else (specifically lacking in examples)?
    Show the love! Click (rate this post) under my name if I was helpful.

    My CodeBank Submissions: How to create a User Control | Move a form between Multiple Monitors (Screens) | Remove the MDI Client Border | Using Report Viewer with Visual Studio 2012 Express

  7. #7
    Addicted Member
    Join Date
    Jan 2008
    Location
    Pittsburgh
    Posts
    169

    Re: [2005] CDO or PIA?

    There is a lot of PIA documentation but it is all written with the most vague explanations.
    If you're going to be crazy, you have to get paid for it or else you're going to be locked up. -- Hunter Thompson

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width