Quantcast
Channel: CodeGuru Forums - Visual C++ Programming
Viewing all articles
Browse latest Browse all 3027

How to intercept email messages generated by another program?

$
0
0
I need to catch email messages that are generated by this custom software that I do not have source code for. (My final goal is then to re-route them into a VM, where Microsoft Outlook will be actually installed and running, that I will use another program to send out those emails with.)

But at this stage I need to write a "shim" that will act as Outlook that should intercept all outbound emails from this software.

The software has this setting, called "Send emails via:":

Name:  YfqGP.png
Views: 23
Size:  3.1 KB

so I'm guessing that it uses Outlook settings as a default email client in the registry to dispatch those emails.

The question is how do I intercept the emails that it sends out?


If I run this software on a clean machine (without Outlook installed) I get the following error in its log file, that reveals which .NET function it uses to send emails:


HTML Code:

    2017-03-09 14:24:52
    MAPI Error: ?unknown? [-2147467259]
   
    2017-03-09 14:24:52
    General MAPI failure [2]
   
    2017-03-09 14:24:52
   
    Cannot create ActiveX component.
    method
      at Microsoft.VisualBasic.Interaction.CreateObject(String ProgId, String ServerName)
      at SLNet.GUIHelper.Email.SendMail(String sToAddress, String sCc, String sSubject, String sBody, ArrayList arrAttachments, String sBcc)

Attached Images
 

Viewing all articles
Browse latest Browse all 3027