Windows SMTP even Sinks

Posted on 2009-02-19
Last Modified: 2012-05-06
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.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

Question by:nightstoat
    1 Comment
    LVL 22

    Accepted Solution

    Take a look at this page ... I think it might have what you are looking for

    You might need to look at the menu in the left hand window as opposed to the content of the right window.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Today I came across an interesting issue that had me pulling my hair out.  I was troubleshooting a new internal web site which uses integrated security instead of anonymous.  When browsing the site from my laptop, I was able to access it with no iss…
    Logparser is the smartest tool I have ever used in parsing IIS log files and there are many interesting things I wanted to share with everyone one of the  real-world  scenario from my current project. Let's get started with  scenario - How do w…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now