Monitor SMTP server

  • Thread starter Thread starter Razzie
  • Start date Start date
R

Razzie

Hey all,

I need to connect to an SMTP server and get a notification when it gets a
new mail to send. I want to be able to 'read' that email (retrieve recipient
information for example).
Is that possible? After much much researching I came across this article on
MSDN:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsmtps/html/writingmngsinks.asp
but it is *horrible*. I downloaded the needed files for it and get stuck in
step 2 even (I have some missing files that supposedely are in the download,
but they aren't). Anyway, that article won't help me.

Does anyone have any sample code or other good articles about how to
accomplish this?

Thanks,

Razzie
 
I need to connect to an SMTP server and get a notification when it gets a
new mail to send. I want to be able to 'read' that email (retrieve recipient
information for example).

What *kind* of SMTP-server?
Is that possible? After much much researching I came across this article on
MSDN:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsmtps/html/writingmngsinks.asp
but it is *horrible*. I downloaded the needed files for it and get stuck in
step 2 even (I have some missing files that supposedely are in the download,
but they aren't). Anyway, that article won't help me.

Well, the stuff is for the Exchange Server. Do you run it?

bye
Rob
 
Not sure what SMTP server you are talking about, but this article and
accompanying code is to be used with Windows 2000 SMTP or Exchange server
only.

Willy.
 
Thanks repliers,

It is meant for Exchange yes. I know little about Exchange or the different
kind of SMTP. I figured since every SMTP server uses the same protocol
(smtp:P) it doesn't matter what kind of smtp server.

Anyway to be a little more precise, if a person uses outlook, webmail,
telnet, whatever, to send an email, I want to directly check that email for
certain settings. If only I knew how to connect to an smtp server and get
the emails being sent... I take it I have to use SMPT event sinks, but was
wondering if it has to be so difficult:

- I found 2 articles (one on codeproject, and that msdn article) they all
use com objects, with which I have difficulties deploying it to a server
other than my developing pc
- Both articles didn't work for me (the MSDN one is really missing some
files in its download, the codeproject one didn't want to deploy for me)

Is there any other easy tutorial out there or some code samples?

Thanks,

Razzie
 
If you run Exchange Server 2000 or 2003 you must use the technique described
in the MSDN article, note that you must install/run the code on the server
running Exchange, so if you don't have access to the server running
Exchange, you can forget about eventing.
Note that eventing is a service offered by the smtp service on W2K and W2K3
and Exchange 2000/2003, this is not part of the standard so other servers do
not apply.
Maybe you could start explaining what problem you had and what you mean
with step 2 in the article.

Willy.
 
Thanks for the details.

My first problem was I didn't have midl compiler. I downloaded the Platform
SDK for it. When I ran the nmake.exe program in step 2 of the msdn tutorial
again, it still couldn't find it. So, running Program Files\Microsoft Visual
Studio .NET\Common7\Tools\vsvars32.bat doesn't work, since the path for midl
is not right.
Then I ran the platform SDK command prompt, now it can find midl.
Now I got an error something like cannot open input file 'MailMsg.idl' and
the program (nmake.exe) aborted. It did find another idl file, just not that
one (and god knows what others it need).

It doesn't say in the MSDN that I need to have anything else installed, so
not to flame, but when I install all this, correct 3 things and still get
errors because I miss a certain file, with no pointers in the MSDN why or
where to get it, I get a bit... angry ;)

Any help with this is appreciated :)

Razzie
 
If you have VS2003 installed with the C++ option enabled, you should find
MIDL.EXE in %VSINSTALLDIR%\Common7\Tools.
Same goes for 'MailMsg.idl' which is found in
%VSINSTALLDIR%\VC\PlatformSdk\include, assumed you selected "Platform sdk"
install during VS setup.

Willy.
 
I have VS2002 and not those files installed. I will browse my VS CD's for
them though, hopefully I can find them. Thanks.
 
Back
Top