Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am looking for understanding on how an SMTP server works.

For example, if I wish to run an SMTP server on Windows 2008 for only one explicit application, which is running on it's web server, application server, and DB server, do I need to register the domain so as to send emails from my domain, if I wish to send emails to some users from that SMTP server?

share|improve this question

migrated from Mar 22 '10 at 5:59

This question came from our site for professional and enthusiast programmers.

No you do not need to register. You can install an SMTP server and start sending emails right away from it. There are some things you should do to avoid being marked as spam though:

  1. Use a static external IP address. Some SBLs will block email coming from a known dynamic IP address
  2. Setup SPF DNS records
  3. Setup a reverse DNS entry for the IP address the server is sending mail from
share|improve this answer

If you don't need to receive e-mail from other people by your smtp server, you don't need to register your domain. If you only need to send e-mail, you can use your smtp server for your application server. but you need to config your smtp server about authentication and relay for your application server.

about authentication, if your smtp server and application is difference machine, you config to allow the anonymous logon except your servers is in the same domain.

about relay, you config to allow the only your application server can relay to your smtp server.

after setting for authentication and relay, you write code by using cdo object for sending e-mail

as following, the sample asp code for sending e-mail by smtp server.

'Sending SMTP mail via port 25 using CDOSYS
'This ASP page uses CDOSYS to send SMTP mail using port 25 of the SMTP server that is set.  The e-mail delivery is handled by the SMTP server that is set in the configuration object.

<%@ Language=VBScript %>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
' send by connecting to port 25 of the SMTP server
Dim iMsg
Dim iConf
Dim Flds
Dim strHTML
Dim strSmartHost

Const cdoSendUsingPort = 2
StrSmartHost = ""

set iMsg = CreateObject("CDO.Message")
set iConf = CreateObject("CDO.Configuration")

Set Flds = iConf.Fields

' set the CDOSYS configuration fields to use port 25 on the SMTP server

With Flds
.Item("") = cdoSendUsingPort
.Item("") = strSmartHost
.Item("") = 10
End With

' build HTML for message body
strHTML = "<HTML>"
strHTML = strHTML & "<HEAD>"
strHTML = strHTML & "<BODY>"
strHTML = strHTML & "<b> This is the test HTML message body</b></br>"
strHTML = strHTML & "</BODY>"
strHTML = strHTML & "</HTML>"

' apply the settings to the message
With iMsg
Set .Configuration = iConf
.To = ""
.From = ""
.Subject = "This is a test CDOSYS message (Sent via Port 25)"
.HTMLBody = strHTML
End With

' cleanup of variables
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing

<P> </P>


you can also use the code. search about CDO object...

share|improve this answer

Yes, you definitely need to register the domain from which you will be sending e-mail. Using a sender address with an unregistered domain will get your messages a first-class one-way ticket to the recipient's spam folder.

share|improve this answer
The answer is misleading: technically, there is no need to own a domain to use SMTP server. It seems that you also make a confusion between reverse lookup and domain registration. – MainMa Jul 21 '10 at 23:37

protected by Iain Jul 13 '12 at 21:02

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?