Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EventInterop.MailMsg Alter Header

Status
Not open for further replies.

uberskunk

Programmer
Apr 9, 2003
28
GB
Hi,

I have a problem and I'm hoping someone can help.

I'm trying to alter the subject field on emails by hooking onto the Exchange transport events. I need to do it this way as it seems to be the only way to do it Asynchronously.

I need to handle the subject field on incoming and outgoing emails which is why I can't use standard event sinks.

I think I could accomplish this if I had access to a resource which described the offsets needed to view the properties in the ReadContent function.

You can see my code below so you can see how I'm trying to so this. The googleatron seems to be lacking in this area as does MSDN (which is no surprise).

Thanks in advance

code:
Imports System.Runtime.InteropServices
Imports Microsoft.Exchange.Transport.EventInterop
Imports Microsoft.Exchange.Transport.EventWrappers

Namespace ManagedSinks

<Guid("560636A3-43E7-4978-A6C2-C8A2C71A10DD")> _
Public Class ExchangeNetSMTPIn
Implements ISmtpInCommandSink

Public Sub OnSmtpInCommand(ByVal pServer As Object, ByVal pSession As Object, ByVal pMsg As Microsoft.Exchange.Transport.EventInterop.MailMsg, ByVal pContext As Microsoft.Exchange.Transport.EventInterop.ISmtpInCommandContext) Implements Microsoft.Exchange.Transport.EventInterop.ISmtpInCommandSink.OnSmtpInCommand
'Code on SMTP Receive

End Sub
End Class

<Guid("7EDC41F9-2112-48a6-962A-1EBB32F53A25")> _
Public Class ExchangeNetSMTPOut
Implements ISmtpOutCommandSink

Public Sub OnSmtpOutCommand(ByVal pServer As Object, ByVal pSession As Object, ByVal pMsg As Microsoft.Exchange.Transport.EventInterop.MailMsg, ByVal pContext As Microsoft.Exchange.Transport.EventInterop.ISmtpOutCommandContext) Implements Microsoft.Exchange.Transport.EventInterop.ISmtpOutCommandSink.OnSmtpOutCommand
'Code on SMTP Send

End Sub
End Class

End Namespace
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top