• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 394
  • Last Modified:

Windows SMTP even Sinks

Hi i am writing an event sink to log all emails sent through an IIS smtp server. it is currently logging the sender, the recipient and the subject.

1   I am trying to understand how it is pulling those propeties (see code below)
2   I also want to add the date that the email was sent
3  Where do i find the different properties that i can log for each email ie msg.to, msg.from, msg.subject
Sub ISMTPOnArrival_OnArrival(ByVal Msg, EventStatus )
  Dim fs
  Set fs = CreateObject("Scripting.FileSystemObject")
  Dim file
  Set file = fs.OpenTextFile("C:\Logs\SMTPLog.csv", 8, True )
  Dim Log 
Log = Now() & "," & Msg.From & "," & Msg.To & "," & Msg.Subject
'  file.Write "From: " & Msg.From & vbCrLf
'  file.Write "To: " & Msg.To & vbCrLf
'  file.Write "Subject: " & Msg.Subject & vbCrLf & vbCrLf
'  file.Write Msg.TextBody & vbCrLf & vbCrLf
  EventStatus = cdoRunNextSink
End Sub

Open in new window

1 Solution
Take a look at this page ... I think it might have what you are looking for http://msdn.microsoft.com/en-us/library/ms526453(EXCHG.10).aspx

You might need to look at the menu in the left hand window as opposed to the content of the right window.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now