?
Solved

Windows SMTP even Sinks

Posted on 2009-02-19
2
Medium Priority
?
376 Views
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.to, msg.from, msg.subject
<SCRIPT LANGUAGE="VBScript">
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.WriteLine(Log)
file.Close
 
'  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
</SCRIPT>

Open in new window

0
Comment
Question by:nightstoat
1 Comment
 
LVL 22

Accepted Solution

by:
cj_1969 earned 1000 total points
ID: 23681410
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.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Running classic asp applications under Windows Server 2008 R2 (x64) and IIS 7 is not as easy as one may think. It took me a while to figure it out while getting error 8002801d a few times. After you install the OS you will need to install the fol…
Lync server 2013 or Skype for business Backup Service Error ID 4049 – After File Share Migration
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…

831 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