How to set up an Internal SMTP Service for Windows Server 2012 Essentials

Windows Server 2012 Essentials does not come with Microsoft Exchange Server as its predecessor Small Business Server 2011 did. However, many small businesses still use a copier or multifunction device that has the ability to scan to email. Some units also allow a fax to email forwarding service. Unfortunately, many of these devices rely on some form of internal SMTP service to enable them to relay emails to recipients.

Fortunately, you can enable a SMTP service that is built into the core operating system for Windows Server 2012. Here how to do this.

Install the SMTP Service

  1. Launch the Server Manager. From the Search charm, type in Server Manager to find it.

     

  2. From the Dashboard, Add Roles and Features. The Add Roles and Features Wizard will begin. Click Next on the first screen.

     

  3. Select Role-based or feature-based installation.

     

  4. Select the Essentials Server (which should be highlighted by default).

     

  5. Click Next to bypass the Roles selections.

     

  6. Scroll down the list and tick the SMTP Server feature.

     

  7. A new window will pop up to inform you that some other services will also be installed. Click Add Features to confirm and continue. Click Next to continue past the features selection screen.

     

  8. Click Install to complete the Installation.

     

  9. Click Close when the installation has completed.

     

Configure the SMTP Service

  1. From the Search charm, type IIS. Hover your mouse over one of the selections, and run the Internet Information Services (IIS) 6.0 Manager.

     

  2. Click Yes to the UAC Prompt.

     

  3. Expand to SMTP Virtual Server #1, right click and select Properties.

     

  4. General Tab: Set the IP Address to the server’s IP address.

     

    Note: You can also enable logging is required.

     

  5. Access Tab: Set the IP for the internal devices in the connection button.

     

    Add the same IP to the Relay list.

     

  6. Delivery Tab: Set an external domain – you can use the free customised domain from Microsoft, and you can also optionally add a Smart host, if required. Tick the Attempt direct delivery box, if you want the server to attempt to deliver the email directly first before trying the Smart host.

     

  7. From the Search charm, type Firewall to locate and run the Windows Firewall with Advanced Security console.

     

  8. Add a new Inbound Rule. (Right Click on Inbound Rule, and select New Rule)

     

  9. Select Port.

     

  10. Type in 25 as the local port.

     

  11. Click Next (Allow the Connection).

     

  12. Uncheck Public. (Prevents external access to the server)

     

  13. Give the rule a name, and click Finish to create the rule.

     

  14. You should now see a new rule enabled in the firewall management console.

     

  15. Restart the SMTP Service and set the service for Automatic Start. Open up the Services Management Console. Double Click on the Simple Mail Transfer Protocol service. Stop and then Start the service. Set the Startup type to Automatic.

     

That’s it. The service is ready and waiting.

NOTE: You can also do this with Small Business Server 2011 Essentials, and also with Windows Server 2012 or Windows Server 2008 R2. With SBS2011 Essentials and Server 2008 R2, there is a slight difference in adding the SMTP Service role, but it is a fairly straightforward task.

102 thoughts on “How to set up an Internal SMTP Service for Windows Server 2012 Essentials”

  1. Thanks for sharing the great knowledge. I have some queries :

    1. How can i send a mail from SMTP in Virtual Image.
    2. I have given the IP as 192.168.2.241 which u have mentioned .Is it correct ?
    3. In smart host i have given mail.mydomain.com . Is it correct ?

    1. You questions are somewhat vague.
      1. Any program capable of using SMTP to send mail can be used to send the email.
      2. The IP mentioned is a sample. You need to use the IP of the Internal Device that will be sending the email.
      3. That is an example. Use your ISP’s SMTP server for the smart host entry.

    1. Your application will send the emails. In the application, you specify this server as the SMTP server.
      The POP3 service is another topic. That is used for receiving emails.

      1. There are quite a number of free POP3 programs available. This blog is primarily designed to enable those who no longer have an on-premises Exchange server to be able to relay emails from their internal devices (photocopiers, server management utility, etc) to their cloud-hosted email service.

    1. Yes, the SMTP service has been around for a very long time.
      No, it is not deprecated and it still works fine in Windows Server 2012.

  2. I am lost at #6. Please give me an example of what I need to place in the FQDN field. Do I type in the servername.mylocaldomainname.local? Or do I type in after the @ on my email name@test.com – so do I type test.com in that field?

    1. You can use any application. The point of the blog is to enable people to have a SMTP server on-premises, when you do not have a mail server to send mail. This is useful for devices like copiers, and network scanners, and for devices that send monitoring alerts and logs to be able to connect to a mail server inside your network.

  3. thank u for replying…..
    if we configure exchange server 2013 we can send and receive mails…. i have enabled smtp ….
    i am beginner for this… i want learn more … plz help me… wat should i refer….
    plz give me idea….

    1. If you have Exchange Server 2013, you do not need to do any of this. I would suggest that you look for a Microsoft Partner in your area to work with you to configure your systems.

  4. Hi, doing some research on how to setup the SMTP server came across with this board….I have being working on this for weeks now without any luck. It is mentioned above that “You can also do this with Small Business Server 2011 Essentials, and also with Windows Server 2012 or Windows Server 2008 R2. With SBS2011 Essentials and Server 2008 R2, there is a slight difference in adding the SMTP Service role, but it is a fairly straightforward task.”
    well will like to know how to can i set the SMTP in a Windows Server 2008 R2 Standard.
    I’m not an expert on it but very interested in finding out how i can accomplished this task…would like to see if anyone can help me with instructions on how to do this part will definitely appreciate it.
    Thanks,
    Mia

    1. It works the same way.

      In Windows Server 2008 R2, you need to install the SMTP Server Feature, which will add the Web Server (IIS) and Remote Server Administrator Tools roles. After that, open the Internet Information Services (IIS) 6.0 Manager and follow the instructions as per the blog.

    1. The point of the post is to be able to receive emails from an internal device, and then send it on to Office 365 or your other cloud email service. So, you need an inbound rule to receive the email from the internal device, and an external relay to send the email on.

      1. I see, thanks for explaining. So what if I wanted a program running on the server to be able to send emails? Would an outbound rule for port 25 do the trick?

          1. I’m not sure I understand the answer to the question. Then again, maybe my question is slightly different. If I want to use my email client on my home machine to send emails through my web server, do I have to create an outbound rule on the server?

          2. The SMTP service is the outbound service. It is a component of IIS, of which the web server services reside.

          3. You say the SMTP service is the outbound service, yet we created an inbound rule. This seems contradictory.

            So I’m still confused. Do we need to create an outbound rule to use SMTP as the outgoing mail server? Or do we use the port specified in the inbound rule as the port for the outgoing mail server?

          4. It depends on your firewalls. By default, outgoing traffic is not blocked in the Windows Firewall. If it is blocked, then you will need to create the specific rule.

  5. Do you have any troubleshooting tips for when the program can’t send emails? I also tried Telnet but the emails are queued, not sent.

    1. Check the logs – SMTP log and firewall log. If you haven’t enabled them, you will have to do that first. Then you will have a better idea of what is going on.

  6. Thanks. Worked beautifully. This is for my UAT server where I dont need to send email but only to send to the UAT mailroot folder. I only made mistake in setting the server address in my program. Because the sample had server name as SMTP.Servername.com, I also thought should set like that. Realize that SMTP. is not a prefix but sample server name. Once I got this right it worked.

  7. What is the function of the FQDN in step 6? SERVERNAME.subdomain.mydomain.local is filled in automatically and when I change it to subdomain.mydomain.com, the domain name is not valid. The firewall log doesn’t show any blocked traffic. The SMTP log shows timeout – 121. All in all not very helpful, I have no idea how to proceed.

    1. Most anti-spam features now will check your FQDN against the public DNS servers to make sure that the domain is valid. If it is not, your email will be rejected.
      If you want to use subdomain.mydomain.com, then you will need to make sure this entry is added to the domain zone file for mydomain.com.

      1. So, if I understand correctly, an invalid FQDN won’t prevent the message from being sent but from being received. Still I don’t understand why subdomain.mydomain.com is not valid. It’s an existing subdomain and when I try to add it as a forward lookup zone, I am told it already exists.

        Meanwhile my e-mails don’t get past the queued stage. It’s driving me insane.

        1. You may have a different problem. This will be difficult to diagnose without more information.
          Meanwhile, you can check your domain FQDN from some sites like hexillion.com and mxtoolbox.com.

  8. Have followed instructions in blog (thanks) and am sending mails & receiving them to microsoft mail on the Win 2008 r2 server using the free visendo pop service. My question is, this only seems to work when the (virtual) server is connected and has access to the internet. Is there any way that the send / receive process can take place when the server is standalone and not networked in any way?

    Thanks

    1. I’m not sure I understand your question. If you want to use the SMTP mail service as described, the SMTP service has to be able to connect to an external mail server to relay the emails. However, if you want to set up your own internal test environment, then you will need to ensure that your DNS server is also located internally, and will forward the SMTP services to the correct place without connecting to the Internet.

  9. I am developing a mailing application and for now I am using gmail server to send and receive mails simply by writing server name as smtp.gmail.com . Howerver now i want setup my own virtual smtp sever and host the application in my college lab using LAN. Can anyone help me what changes i have to make in order complete my task ?

      1. It is a mailing app in asp.net. You give your gmail id and password and using gmail port no 587 I m sending mails to any id. Here i am using gmail server authentication and gmail smtp server to send mails, But i want to set up my own virtual smtp server which will fetch messeges from the database server and send it to the other end. I will host the app in my college lab where computers are LAN connected and will create clients to exchange mail between them. They first have to register into the app, create their ids and send mail using smtp server on the server machine. I have the idea but failing to execute. Help needed badly.

  10. An SMTP server does not “fetch” messages. A SMTP server can only receive messages from a sender, and then it “sends” the message on.
    If you want a mail server that can “fecth” messages as well, you should then consider a third party mail server which has POP3 capabilities as well.

    1. Yes i am using pop3 to fetch messages from gmail smtp server. All i want is to set up my own virtual smtp server which will send and receive messages and pop3 will fetch those messages and show it to the client. I want this set up to be a local one as ids created will be identified inside our network only that is college LAN. How to do it.

    2. What is the term “FETCH” use for in here? I am looking a mail server to host my organization mail (Send , received, draft, etc) without using Exchange server. I have the Windows Server 2012 r2

      1. If you are looking for a mail server to host your company email, then this is not the blog for you. You should look at some third party products that can do the job.
        If you are running a small business with less than 25 users accounts, I would suggest that you can get better efficiency and cost savings in deploying a cloud based email solution like Office 365.

  11. Bonjour , j’ai installer le service SMTP sous windows server 2012 mais lorsque j’ouvre IIS je ne peux pas démarrer SMTP un msg d’erreur s’affiche .

    1. Check the blog again to see that you have set up the SMTP service correctly. Also check to make sure you do not already have another SMTP service running on the server.
      What is the error message in the event log?

  12. All seems fine yet when I go to Open up the Services Management Console there is no listing for Simple… nor SMTP nor even Microsoft Simple…
    Any thoughts?

    1. The service name in the Services Console is called Simple Mail Transfer Protocol (SMTP). It should be there if installed properly.

  13. 잘봤습니다. 정보 감사합니다.
    하지만 저는 이해가 되지 않는 몇가지가 있습니다.
    1.iis8에서는 설정할것이 없나요?
    2.웹에서 코드로 발송을 해보셨나요?

    메일로 답변 부탁합니다.

    1. Hi,
      1. The SMTP service is installed on IIS6, not IIS8.
      2. I don’t quite understand what you mean about communicating in code from the web.

  14. I know this is stupid question but I am new in internal mail and i never tried to setup one. This is my first time to setup internal email because we are in a province which we don’t have internet. Anyone can help me, Thank you very much!

    After the installation and configuration. How will I setup that in outlook?
    Like should I put in e-mail address: banez.rodel@myserver.local
    <–(rodel) because this is my username.
    myserver.local is my domain name.

    Account Type: IMAP
    Incoming mail: imap.myserver.local
    smtp.myserver.local

    Is that correct configuration to be able to send and receive internal email?

    1. This is probably not the right blog post for you to read.
      If you want to set up an internal email system, have a look at some third party POP3 servers. These servers will set up a POP3 service(for receiving email), and SMTP services (for sending email).

  15. I had followed all the steps mentioned above, all the mails are getting stuck in mailroot/queue folder . we are usinh windows 2012 operating system. i was stuck in theis task from past 15 days. can you please help me

    1. What errors do you see in the logs?
      This is usually caused by your server being unable to forward the messages to their destination.
      Check the relay server and DNS.

  16. Hi BoonTee,

    I am getting the below error when i am trying to send the emails . The relay server settings were set as given in the Document. the Smart Host was given as ge.com.

    Message delivery to the host ‘3.159.213.48’ failed while delivering to the remote domain ‘ge.com’ for the following reason: An SMTP protocol error occurred.

    Please let me know where i am missing . i can provide the entire screenshots if required

    Thanks
    Anjani

    Thanks
    Anjani

    1. It looks like your upstream relay server ge.com is not allowing you to send the emails. A company like this would have specific servers that you are allowed to connect to. You will need to check with their IT department for the correct information.

  17. Thanks a lot. Im using Apache server 2.2, so I wanted to know how to configure SMTP for that. I tried that in many sites with no gain. If you have any idea about that please let me know. It will be really helpful for me. My email ID is shetty.karthik1857@gmail.com
    Thank You

    1. This blog post is about Windows Server 2012, which includes IIS for free.
      Apache is a web server and does not include email features (at least not that I know of). You should consider using a third party smtp program to work with your Apache server.

  18. We installed the SMTP server on our windows 2012 server, we are then sending emails out of our Property Management System about 200 at a time and are getting bounce backs on about 1/3 of them, the default “From” user is an email address through a Microsoft Exchange Server, though the domain of the server is different than MS Exchange Server. Is there a limitation on how many emails can be sent through the MS Exchange server via a remote SMTP connection?

    1. You will need to confirm the limits with your forwarding SMTP server. Often, there is a limit on the number of messages that can be sent in one go. You should also check out the SRV records on the domain to make sure they are correct.

  19. hello,
    i am currently working on a solution which of course requires smtp configurations for emails.i want to knw the difference between an internal SMTP and ISP smtp configurations.

    Thanks.

  20. I have setup the SMTP service on a server 2012 server. I want to use this as an internal relay for scan to email and to send reports from an application to internal users. I also want to have the application send out emails to external users. Is this where the smart host would come into play, to send out externally?

  21. Hi BoonTee,
    In your post on MAY 27, 2014 AT 8:52 AM, you suggested finding a 3rd party POP3 server which has a SMTP Service for sending email. What is the difference in that SMTP service and the SMTP server/service which comes with IIS? Can the IIS SMTP not just send email without Relaying it to another email service?
    I’m trying to create a way for a simple application to send emails. This app does not have the ability to be configured with security, ports, and such. It’s only parameter is ’email server name’. Can I get IIS SMTP to do this, or do I need to find another application – and if so, can you, or someone recommend a good, reliable, free one?

    Thanks,
    Mike

    1. The comment I was replying to was from Rodel R. Banez. He wanted to set up a mail server where he could receive AND send email. SMTP is a standard protocol, and there isn’t much difference in using either. If you deploy a third party email system, it will probably incorporate some sort of SMTP server as well.

      1. Thanks BoonTee. This is a great blog, and very helpful!

        So then to make sure I’m clear, I should be able to set up the SMTP on IIS to be able to just send email and not relay it through some other existing email server/account?

        Thanks,
        Mike

        1. Yes, you can set up SMTP on IIS to send mail without a relay.
          However, be careful that many spam filters may reject this if you do not have your MX records and domain records configured properly.

  22. Hi, I’ve set up windows server 2012 running on Oracle VirtualBox on a Windows 8.1 OS to allow me to test SSIS 2012. I’m trying to use the SMTP service as shown on this page but am struggling to tell whether it is working or if outgoing emails are being blocked locally, by my host OS, or by my ISP.
    I am seeing this Event: Message delivery to the host ‘109.aaa.bbb.ccc’ failed while delivering to the remote domain ‘ddd.co.uk’ for the following reason: The connection was dropped by the remote host.
    When I try and use PowerShell to send a test email [Send-MailMessage -SMTPServer localhost -To mark@domain.com -From virtual@domain.co.uk -Subject “This is a test email” -Body “Hi, this is a test email via PS”] I get the following error:
    Send-MailMessage : Unable to read data from the transport connection: net_io_connectionclosed
    I’ve tried using a domain I own as the Advanced Delivery Fully-qualified domain name; and also my local ISP SMTP details. Neither seems to be working.
    Can you advise the steps I need to take to trouble shoot this?
    Thanks
    Mark

    1. You need some tools to check where the issue lies.
      Port scan tools may help. Also, try using some of the online tools.
      It could also be due to spam filtering on the recipient mail servers.

  23. I found this post really helpful, thanks a lot for the information.

    After reading all the questions it is still not clear for me if I can configure the SMTP server tod work locally wihtout the relay servrer.

    I am trying to do a school practice configuring e-mail service to be accesed from a client to a server configured with DNS, DHCP, etc.

    The thing is that I want to configure Outlook be configured on a client PC to send e mails to another client under the same local network without internet connection

  24. we have a hosted exchange server with terrible support, where email sent to @ourdomain.com arrives.

    we also have our own server with SMTP/IIS 6 admin installed, and we’ve been using it for years, with the FQDN set to @anotherdomain.com, but with from=someone@ourdomain.com.

    once in a while we get “suspected spam” rejection. I’m thinking it’s maybe because our from =/= @anotherdomain.com

    I once tried setting the FQDN on our SMTP server to @ourdomain.com, but oddly enough, our copier scans were not going through … I immediately set it back.

    best guess is, since the to address domain was the same as the FQDN on our SMTP, it thought it had already arrived at the proper server.

    I tried using the masquerade domain, but in a quick test, it’s still using the FQDN in the Message-ID.

    anyhow, is my guess close to accurate? or am I doing something else wrong?

    thanks!

  25. Pingback: How To Configure Windows Firewall In Windows Server 2012 | Khpost168
  26. hi,
    i tried ur procedure,but i faced this problem..while accessing access tab my ip address access is denied… how to enabled this.. help me pls..

  27. Hi,

    I have around 20 people sending too many email in every hour with different domain. All are different domains brought from different service providers.

    What I want is to send all emails from one particular system. Something like they send all emails as usual and emails will be collected in one place PC/Server and it gets delivered outside our network (Internet or receiver through out the globe).
    Also if above is possible I can easily rotate my internet connections so that emails will not be delivered outside using same internet connection all the time rather emails get delivered with different broadband connections.

    Is there anyways I can achieve this?

    Thanks in advance for helping me achieve this.

  28. I set up the relay on my server and it works great for sending to clients external to my domain. However, I cannot send to anyone within my domain. Part of the problem might be that their internal domain matches their external website. Any suggestions? Possibly a dns error or something?

      1. I don’t know how this may sound, But I want to be very clear on what I want to ask.

        I have a windows server 2008 (AD) domain network and I would like to add a mail server role on the server machine that would allow me to configure outlook on the client machines, so that users can send and receive e mails within the local domain network.

        Please is this possible?

  29. Really this post was very conceptual configure step by step which is anyone can configure on us based server thank you for helping post.

  30. I need to be able to relay messages from external sources. Do you have any resources I can use to add authentication to the SMTP server so my relay isn’t just open to the internet?

    1. You should use a third party SMTP service. This is a simple SMTP service that is there to get you out of trouble if you need something basic off the server.

  31. Good write-up. The pictures are nice and clear, and still relevant even 4 years later using regular Server 2012R2 (not SBS). Thanks man.

  32. I already deployed SMTP server and what I have to do to connect with internal device (My Printer) and what I have to do to send scan documents to office email?

    1. In the printer setting pages, look for SMTP Server. Put in the IP address of your server. Do the same to configure the scanner.
      In some cases, if you are scanning to external sources, you may need to set up SPF records for your domain.

  33. Hi Boontee,

    I am running exchange server 2010 and i send my external email via send connector and that connector is configured with an ISP SMTP Server IP as a smart host in my send connector.

    Now if i configure this internal smtp server and NAT its LAN IP with Public IP on firewall (ISP IP) and create a new send connector in exchange server and add this smtp server IP in smart host section of send connector. Then will my external emails will be sent by using this internal hosted smtp server

      1. Actually Sir, i have a different headache. i use ISP SMTP Server public IP for external emails transfer. Now for this i have to pay ISP on monthly basis. I have also the unused public IPs which are not of no use and are free.

        So what i want to NAT these public IPs with my internal SMTP Configured in this way as you described in the blog, then use the IP of smtp server in send connector of my exchange server.

        Is this possible?

        1. This is quite an old post from 2012. Nowadays, you can use third party SMTP servers to do the same thing. Many of them are free. One that I use is smtp2go.
          Unless you are sending mass marketing emails, these services will provide a better and safer way to send emails from internal devices.

          1. Sir, can these third party services will fulfill my request i.e if i NAT the public IPs with the private IPs of these third party SMTP servers, then can i able to configure these smtp servers as a send connector in my exchange servers for external emails routing.

            Need help in this.

Leave a Reply

Your email address will not be published. Required fields are marked *

Solve the Equation to continue * Time limit is exhausted. Please reload CAPTCHA.