Pages

Wednesday, March 23, 2011

2008 SMTP server

I am building a SMTP server on 2008. I turned it on in IIS and when I run a script it sends my test email but when I try to get my servers to use it to send message no messages go through. Is there something I could be missing? The script below is the one I use and it works fine.  I get a test email okay.

Const MAIL_SERVER = "smtp server"

Set objMail = CreateObject("CDO.Message")

objMail.Subject = "Message: " & Now
objMail.From = "email address"
objMail.To = "email address"
objMail.TextBody = "Test"

objMail.Configuration.Fields.Item _
  ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objMail.Configuration.Fields.Item _
  ("http://schemas.microsoft.com/cdo/configuration/smtpserver") _
  = MAIL_SERVER
objMail.Configuration.Fields.Item _
  ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") _
  = 25

objMail.Configuration.Fields.Update
objMail.Send


Solution :-
On Windows 2008, You can run SMTP with default setup, You only need to change Access tab ->Relay Restrictions, select the radio button "Only the list below" and there you can add the IPAddress or IP range of machines that you want to send emails from this server.
And under Delivery -> Advance  -> Mention  FQDN for the domain name or server name in question. If this server is part of Example.com Active directory domain, then you can create an MX record in DNS. So you may check these few settings.
Cheers!

No comments:

Post a Comment