Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

migrated from stackoverflow.com Mar 22 '10 at 5:59

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

3 Answers

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
add comment

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 %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<%
' send by connecting to port 25 of the SMTP server
Dim iMsg
Dim iConf
Dim Flds
Dim strHTML
Dim strSmartHost

Const cdoSendUsingPort = 2
StrSmartHost = "mail.example.com"

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("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSmartHost
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
.Update
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 = "nrnoble@example.com"
.From = "nrnoble@example.com"
.Subject = "This is a test CDOSYS message (Sent via Port 25)"
.HTMLBody = strHTML
.Send
End With

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

%>
<P> </P>

</BODY>
</HTML>

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

share|improve this answer
add comment

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
1  
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
add comment

protected by Iain Jul 13 '12 at 21:02

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

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