No announcement yet.

Add Disclaimer (modify message) with Exchange event sink and c#

  • Filter
  • Time
  • Show
Clear All
new posts

  • Add Disclaimer (modify message) with Exchange event sink and c#

    Good morning...
    I'm working on a little software to add disclaimer to my microsoft excange or windows iis smtp outgoing emails.

    I'm using the and with keypair.

    Then i registred my com class into the system and binded it to the smtp connector via SMTPREG.VBS

    now i'm using the OnPostCategorize event.

    i have a MailMsg type object passed into the function like this...

    void IMailTransportOnPostCategorize.OnMessagePostCatego rize(MailMsg pMsg, IMailTransportNotify pNotify, System.IntPtr pvNotifyContext)
    Message msg = new Message(pMsg);
    /// code inside

    now.. trough msg.. i can read all message parameters. but when i try to modify theese parameters... all parameters are read only.

    if i try to read or write directly the pMsg with PutStringA or GetStringA, i have empty strings in the reading and if i try to write... i have no result, the message remains the same.

    Is the OnPostCategorize the correct event to do this task?

    Is it better to use CDO and OnArrival event?

    What is the correct way to modify messages?

    Thank you.