SMTP.WS Microsite - Microsoft SMTP Service

Welcome to SMTP.WS

“Providing information about Microsoft SMTP Service”

Relay Restrictions and SMTP service, IISOLE.dll reference

This is one of *those* posts I refer to from time to time.  There have been a few posts on regarding how to manage relay restrictions in SMTP service.   I've used the IISOLE.dll against an IIS 6 server with no issues.  I've not tested on IIS 7, so mileage may vary.  Make sure to install the IIS 6.0 compat modules and test on a non-production box.   If nothing else, download a trial version and create an instance using vmware, hyper-V or Virtual PC.

Here is one way using code.  You'll need to get the IISOLE.dll which is the COM interface.

1) Download VB 2008 express (search for this link) 

2) Go to codeplex and download this project, extract the OLEDLL.dll

3) Make a project in VB2008 express

4) Make a reference to the IISOLE.dll

5) Paste this code into your main and run

Dim objValue As New DirectoryEntry("IIS://localhost/smtpsvc/1")
Dim objIPSec As IISOle.IISIPSecurity = objValue.Properties("RelayIpList").Value
objIPSec.IPGrant = New Object() {"", ""}
objValue.Properties("RelayIpList").Value = objIPSec

Here is a reference of the entire IISOLE.dll.

 Here is the additional post.

Happy SMTP

Steve Schofield
Microsoft MVP - IIS