Setup and Configure SMTP Server on Windows Server 2008 R2

There has been some confusion about how to setup and configure SMTP on Windows Server 2008 R2. The confusion has arisen due to the SMTP server component not being managed from with IIS 7.5 but is instead managed from the IIS 6 console.  In order to have SMTP working you must install IIS 6 as a feature. The following steps will explain how to setup and configure SMTP from start to finish.

Installing the SMTP feature

1. Click Start > Run and then enter servermanager.msc in the Open dialogue box then click OK to load Server Manager:

C:\>servermanager.msc

2. Use the Add Features Wizard to select SMTP Server on the Select Features page. To initiate this, right-click on Features and click Add Feature:

3. In the Features section check SMTP Server and click Next:

4. You may see a dialogue box like the one below stating that certain role services and features are required for SMTP:

5. Click Add Required Role Services and then you will return to the previous Features section. Ensure SMTP Server is checked then click Next.

6. In the Web Server (IIS) section, click Next to proceed to the Role Services section:

7. The Role Services should be pre-populated – IIS 6 Management Compatibility should be selected, and below it, IIS 6 Metabase Compatibility and IIS 6 Management Console should also be checked. Click Next to continue:

8. In the Confirmation section click Install:

9. In the Results section click Close to complete the installation of the SMTP Server:

Configuring the SMTP Server

The next step is to configure SMTP. To do so we will need to open Internet Information Services (IIS) Manager 6.

10. Click Start > Run and then enter inetmgr6 in the dialogue box then click OK to load IIS Manager 6.

11. In IIS 6 Manager right-click on SMTP Server and select Properties:

12. In the General tab, unless you want the SMTP Server to use a specific IP address,  leave the settings as they are so that the IP address is set to (All Unassigned):

13. To proceed, click on the Access tab:

14. Click on the Authentication button and ensure Anonymous access is checked and then click OK:

15. Once back in the Access tab, click on the Connection button. Select Only the list below and then click Add. Enter 127.0.0.1 as the IP addess and then click OK:

The Connection setting controls which computers can connect to the SMTP server and send mail. By granting only localhost (127.0.0.1) access, limits only the server itself the ability to connect to the SMTP server. This is a requirement for security.

16. Click OK to return to the Access tab and then click on the Relay button. Enter 127.0.0.1 as the IP addess and then click OK:

The Relay section determines which computers can relay mail through this SMTP server. By only allowing the localhost IP address (127.0.0.1) relay permissions it means that only the server itself can relay mail. Conversely, it prevents the SMTP server from being an open relay and being used to send unsolicited spam email by other computers on the internet, which could lead to the SMTP server being blacklisted.

17. Next, go to the Messages tab. Here you can enter an email address where copies of non-delivery reports are sent to. You can also configure the location of the Badmail director, however, the default setting should suffice:

20130427131034

18. Next, go to the Delivery tab:

19. Click on the Outbound Security button and ensure Anonymous access is selected. As the only server that can connect and relay mail through the SMTP server is localhost this security settings is fine:

20. Click OK to return to the Delivery tab and then click on Outbound Connections. Leave the defaults as they are:

21. Click OK to return to the Delivery tab and then click on Outbound Connections, then click on the Advanced button:

20130427131219

Here you will need to enter the fully-qualified domain name of the SMTP server. This will be the host name or A record that has been created in your DNS zone file. This is straight-forward to do but you will have to confirm how you do this with the party that manages DNS for your domain. I have entered mail.vsysad.com as this is fully-qualified. If you click on the Check DNS button you can confirm whether your chosen name resolves successfully. In my case it does as I see the following:

 22. Click OK and then OK again to exit the SMTP Virtual Server Properties.

You can also perform this test by running nslookup to confirm the existence of the host name as well as confirming the IP address it resolves to – which should the IP address of your server:

20130427131924

Testing the SMTP Server

The next step is to verify that the SMTP server is able to send email successfully. To do this follow the steps below:

23. Create a text file on your desktop called email.txt and paste the following into it, remembering to change the email address information to reflect your own details:

From: blog@yourdomain.com
To: email@yourdomain.com
Subject: Email test

This is the test body of the email

.

24. Save the changes to email.txt and then copy the file to C:\inetpub\mailroot\Pickup. The SMTP server monitors this folder and when it detects the email.txt file, it will read the contents and send the email to the address in the To: section. This should happen almost immediately.

25. Check the email address the email was sent to and it should arrive shortly – the email was sent to my Gmail account:

20130429184511

An alternative way of doing this is to use a script to perform the same email test. Simply save the code below into a file called email.vbs, remembering to change the email address information to reflect your own details:

Dim sch, cdoConfig, cdoMessage
sch = "http://schemas.microsoft.com/cdo/configuration/"
Set cdoConfig = CreateObject("CDO.Configuration")
With cdoConfig.Fields
.Item(sch & "sendusing") = 1 ' cdoSendUsingPort
.Item(sch & "smtpserver") = "127.0.0.1"
'    .Item(sch & "smtpserverport") = 25
.update
End With
Set cdoMessage = CreateObject("CDO.Message")
With cdoMessage
Set .Configuration = cdoConfig
.From = "blog@yourdomain.com"
.To = "email@yourdomain.com"
.Subject = "Email test"
.TextBody = "This is the test body of the email"
'.AddAttachment "c:\images\myimage.jpg"
.Send
End With
Set cdoMessage = Nothing
Set cdoConfig = Nothing
MsgBox "Email Sent"

Once the file has been saved to the desktop double-click on it and it should automatically send the the email. A message box pops up to confirm that the email was sent:

Note: You can also use telnet and PowerShell to test mail sending/routing via SMTP Server. Please refer to this post to see how to do this.

That’s all there is to it! Now you have a fully functioning STMP server that can successfully send emails. Many of the companies that I have worked with use this method to send emails generated by their web applications.

Troubleshooting

DNS

It is essential to have DNS setup and working properly, if not you may experience problems with mail delivery. Follow the instructions in this post which shows you how to verify correct DNS configuration using the SMTPDIAG tool. Ensure that you have a PTR record for reverse DNS lookups configured. The PTR record allows your SMTP server’s public IP address to be resolved back to your hostname. Some of the major email hosts use this technique to block spammers. Your web host should have a control panel that allows you to configure reverse DNS if you have a dedicated public IP address. Rackspace Cloud users can follow this link for instructions on how to create a reverse DNS record.

SMTP Folders

If emails are not being successfully delivered you may notice that messages are building up in specific SMTP folders. These are likely to be, but not limited to, Badmail & Queue. Please visit this post to understand the purpose of each SMTP folder and how to approach issues when messages are queuing up in those folders.

References:
How to test outbound mail flow with a file in the Pickup folder
IIS SMTP Folder Structure and how SMTP service works

  • Juan

    all my emails are queued, not out? What more need?

    • japinator

      Hi Juan. Do all emails end up being queued? Do any emails send successfully at all? Can you test mail routing using STMPDIAG? Go to this post and run the test and let me know the results.

      • john

        please i apply this method of sending mail from window server but does not delivery email to all domain , like gmx ,rediffmail and it deliver to yahoo , please can you help me to slove this probelm

  • http://gravatar.com/marketingismagic marketingismagic

    I’m getting a “The service could not bind instance 1.” in the event log viewer for SMTPSVC. Any clues? This system has been working for a couple of years and only recently failed.

    • japinator

      Hi, it sounds like a port binding issue. So another service or program has bound itself to port 25 which is preventing the smtp service from binding to it. Try running the following command netstat -ano | find “:25″ which will look for the string :25 (port 25) in the output. The result should tell you the IP that port 25 is bound to and also the PID (process ID) using it. You can can then go into task manager to identify the PID and subsequent process. Try that and let me know your findings.

  • Ismail

    my emails are moving into bad mail folder

    • japinator

      Hi Ismail. Typically mail is moved to the Badmail folder when it cannot be forwarded to the intended recipient. In the Badmail folder open up BAD file to see the error message. Check the Diagnostic-Code specifically. Can you confirm whether all emails go into the Badmail folder or whether it happens for a small number?

      • ismail

        all mails go to the bad mail folder immediately

        • japinator

          In the Badmail folder open up BAD file to see the error message. Check the Diagnostic-Code specifically and confirm what’s there. We cannot know the cause if we dont have info such as error messages. Can you confirm whether all emails go into the Badmail folder or whether it happens for a small number?

  • Pingback: Setup and Configure SMTP Server on Windows Server 2008 R2 | vSysad « nileshnaik

  • Siraj

    My emails are in the queue folder.

    • japinator

      Hi Siraj. Emails sit in the Queue folder when they cannot be sent/delivered. If the delivery fails with an error then they go to the Badmail folder. It sounds like a DNS problem. The best way to find out more is to enable SMTP logging. See this link to find out how to enable logging. Once enabled, the logs will indicate what is happening when mail delivery is attempted.

  • Naeem Munawar

    i created SMTP Server on windows server 2008 Standard. i want to configure and use this smtp server on my client computers. please guide how can i do this.

    • japinator

      You must first configure the server to allow connections from your clients. Go to Access tab > click on Connection button and add IP subnet of the clients. Then go back into the Access tab > click on Relay button and add IP subnet of the clients. Decide your preferred authentication method from the Authentication button. Then configure your clients to connect to the SMTP Server by either its IP address or FQDN (step 21 in the post).

      • Naeem Munawar

        Thank you for your reply. i just do that before your reply. but it is helpful for me to understand. can you tell me is there any utility to see live logs of the SMTP server. i want to see how many emails are being send from each user.

        • japinator

          There are commercial products that monitor the SMTP service and provide log analysis reports. Personally I would use the Microsoft log parser tool to scan the logs for specific strings and output it to a file such as csv or html.

  • Aditya Gupta

    I haed run the command netstat – ano and found that 25 port wasn’t in the list
    also, few of the mails i have found are in bademail folder, and some in queued. Saw logs in system32->smtpsv1 folder,
    something like ——–”
    220+mx2.emailsrvr.com+ESMTP+-+VA+Code+Section+18.2-152.3:1+forbids+sending+spam+through+this+system 0 0 99 0 609 SMTP – - – -” appeared

    • japinator

      First thing to check is whether the SMTP Virtual Server is listening on port 25. Go to the properties > General tab > click Advanced and ensure port 25 is set under 25. If not change it to port 25 as this is the standard smtp port. Then restart the smtp service. The intended recipient’s email server is ‘mx2.emailsrvr.com’ and they have blocked sending email to the recipient. This is because they will perform a reverse DNS lookup on your SMTP Server’s IP address and if it doesn’t resolve they will assume that you are a spammer and then block the mail delivery. This post covers a similar issue to yours.

  • aditya gupta

    now i am able to send mails easily with this server by running the script you specified.

    but now i want to use this server to send mails from another system, which i have authenticated in properties. I mean i have allowed all system to use my smtp server.. now please tell how may i send it from another system which says, ‘pickup directory path not specified “

    • japinator

      Try testing whether you can send mail from the other systems by running the same script. You will have to change the IP from localhost (127.0.0.1) to the IP of the SMTP Server. That way the other systems know where to send the mail. You shouldn’t see that problem anymore. Hope that helps.

  • Resistance-k

    Hello everyone, I also had the problem of all my emails getting queued (staying in the Queue folder and not being sent) by the SMTP server on windows server 2008 R2 after following the steps outlined in this article.

    After hours of research and trials, it turned out that you have to add an empty line at the end of the email.txt file (step 23 above).

    The email.txt file should end by a CR LF character, otherwise it will not be picked up by the receiving email servers, thus all your emails will stay in the queue folder.

    If the author of this article can update his text (step number 23) this would save the hassle of a lot of other users. Thanks.

    HTH.
    Best regards.

    • japinator

      Sorry to hear that you experienced some issues sending mail. I performed some testing and did not experience any problems sending to multiple mail servers running both Windows & Linux mail servers. It seems that with or without the line in the body ending in ASCII CR LF characters the emails should send ok.

    • japinator

      Hi Resistance-k, I have amended the email.txt file in step 23 per your advice. I generally don’t use this method for testing but decided to look into it further. My research found that some mail servers required strict adherence to RFC 2822 whereas others didn’t, which in turn impacted the delivery of emails. Thanks for pointing this out, kudos to you.

  • AlwaysLearning

    Since there is no GUI to set the Badmail and Pickup directories you must resort to using the adsutil.vbs file (installed at C:\inetpub\AdminScripts\adsutil.vbs by default) to edit the IIS metabase.

    The Microsoft advice for changing the Badmail, Drop, Pickup and Queue folders at the following URL is mostly-wrong, at least for IIS6:
    XIMS: Relocating the Directories Used by SMTP Service
    http://support.microsoft.com/kb/240917

    The correct commands are:
    adsutil.vbs set smtpsvc/1/dropdirectory “DriveLetter:\inetpub\mailroot\Drop”
    adsutil.vbs set smtpsvc/1/badmaildirectory “DriveLetter:\inetpub\mailroot\Badmail”
    adsutil.vbs set smtpsvc/1/pickupdirectory “DriveLetter:\inetpub\mailroot\Pickup”
    adsutil.vbs set smtpsvc/1/queuedirectory “DriveLetter:\inetpub\mailroot\Queue”

    Hope this helps somebody.

    • japinator

      Thanks, that info is very useful. The only folder location you can configure from the GUI is the Badmail folder. Step 17 in the post shows the Messages tab where this can be configured.

      • Eddie

        Sorry. I do not know how to create SMTP email accounts in Windows Server 2008 R2. Can you help me out on this please?

        • japinator

          Hi Eddie. The SMTP Server sends email only. The SMTP Server within IIS is generally used to send email generated from Web applications. You cannot add email accounts within it to enable receiving mail as this is not the role of an SMTP Server. If you need to be able to receive email to your domain you will either have to setup a server to handle incoming email such as a POP3, IMAP or Exchange Server or you can use a hosting company to provide you with this service. If your goal is merely to test that the SMTP Server works simply use your personal email in the To: section.

  • Eddie

    Sorry. How do I create a To: and From: email accounts for testing?

    • japinator

      For testing use your personal email in the To: section and you should use an existing email address from your domain in the From: section.

      • Jeffrey Lua

        Can I send send an email where the from is not an existing email address from my domain. Say the following information To: user1@gmail.com from user2@yahoo.com?

        • japinator

          Yes, as long as you use an email address from your domain. So I could test@vsysad.com as an address when sending out mail through my SMTP Server.

  • Pingback: Anonymous

  • badr

    i did all this but i can’t find any email on my email adress :( nothing at all no inbox no spam , just nothing :’(

    • japinator

      Would you care to elaborate on the problem? What tests have you run? What do you see in the logs?

  • Kieran Johnston

    Hello,

    I did this but it is not working. The email.text stays in my Pickup folder. I did the SmtpDiag test here is my results: http://gyazo.com/712f38545fd0715a5506c525d83a83fd

    If you know how to fix this or point me in the right direction please let me know ASAP.

    If you would like me to screen share or anything please add me on skype my username is kieran.johnston14

    -Best regards
    Kieran

    • japinator

      I emailed you offline about this.

  • Carry_Grant

    Thanks for the post.

    I am setting up an environment where an application needs SMTP. I don’t need to send eMails externally outside of my lab:

    Application Server = Server 2012, My App, SMTP
    Exchange Server = Server 2012, Exchange 2010

    I don’t understand how SMTP interfaces with Exchange. Can you explain?

    All of my eMails are stuck in the queue.

    Cheers

    • japinator

      Apologies for the late reply. Exchange 2010 has its own transport engine which uses the SMTP protocol and is separate from Windows SMTP Server, which is what I refer to in my post. Please confirm that the emails you refer to as being stuck are on the application server? I suspect DNS has not been configured properly so the SMTP Server running on the application server cannot resolve the intended recipients’ domains to the Exchange server.

      • Carry_Grant

        I had to setup the Exchange Send and Receive connectors and also create an “Accepted Domain” in Exchange. Then your instructions worked. Thanks

  • Andyman

    Outstanding. You made something that would seem overly complicated extremely simple. Followed your instructions and images word for word and got this working in 5 minutes. You’re a gentleman and a scholar and I appreciate your writing this up!

    • japinator

      Hi Andyman, thanks for your kind words. I am very happy to hear that you were up and running in 5 minutes!

      • Andyman

        Just an excellent job with the screenshots.. made it child’s play. Thanks again.

  • John Kenny

    Thanks for the post.
    I have succeeded in sending email from the vbs file but not using the email.txt file.
    Any Ideas?

    • japinator

      Hi there, if the vbs file works then SMTP is working. The issue may well be with the txt file. Resistance-k commented earlier about this and highlighted a possible cause – the txt file not ending with a ASCII CR LF character. If the vbs file works I wouldn’t be too concerned. Alternatively you can test using telnet, instructions are here:

      http://support.microsoft.com/kb/153119

      Hope that helps.

    • japinator

      I have updated section 23 slightly. You should have more success with the email.txt file now.

  • Galacticos

    Thanks for the Super Awesome Knowledge which you have shared here. I would like to know can we use command prompt to send email ? In linux, We are using sendmail function and we will pass the parameter like (To, subject, From Subject ). Please let me know. Thanks for the Help.

    • Guest

      From a PowerShell prompt:
      PS C:>Get-Help Send-MailMessage

      • Galacticos

        Thx..:)

        • japinator

          Hi Galacticos! As the guest poster alluded to above, you can use PowerShell’s Send-MailMessage cmdlet. So run the following from the PowerShell console on your SMTP Server to send an email:

          Send-MailMessage –SMTPServer localhost -To galacticos@test.com –From blog@vsysad.com –Subject “This is a test email” –Body “Hi Galacticos, this is a test email sent via PowerShell ”

          The full command line reference for this cmdlet can be found here:

          http://technet.microsoft.com/en-us/library/hh849925.aspx

          • Galacticos

            Thanks Japinator…:)

  • McFruit

    Thanks for your tutorial!
    I’m using php to create *.txt-files inside the pickup directory. All works fine but unfortunately I’m not able
    to send html e-mails. What kind of header information are necessary to generate a valid html e-mail? Thanks for your support.

    • McFruit

      Problem solved. I guess messy whitespaces aren’t welcome.

      From:
      To:
      Subject: {SUBJECT}
      MIME-Version: 1.0
      Content-Type: multipart/alternative;
      boundary=”Attached”

      –Attached
      Content-Type: text/plain;
      Content-Transfer-Encoding: 7bit

      Use an HTML compatible email viewer to view this message!

      –Attached
      Content-Type: text/html; charset=utf-8
      Content-transfer-encoding: 8BIT

      {HTML_BODY}

      –Attached–

      • japinator

        Nice! Never been asked that before as the txt file is used for testing mail delivery only but it is definitely with knowing. Thanks for the info.

  • Pingback: Setup and Configure SMTP Server on Windows Server 2008 R2 | ASP.NET and C# code snippets

  • Mircea San

    Thank you for information, very useful. I followed the steps, but I am stuck at one point. What I am trying to do is to send email through a SMTP server to Exchange 2010. I created send and receive connectors, but it still doesn’t work. I don’t think it’s a firewall issue as firewall is disabled. Messages remain stuck in the Queue folder. Any ideas what could be the problem?

    Thank you in advance!

    • japinator

      Hi Mircea, my guide is for setting up SMTP Server and NOT configuring SMTP on Exchange whhich does require setting up send and receive connectors. Are you setting up an Exchange server and trying to get the send connector working?

      • Mircea San

        Hi, thank you for your reply.

        The idea was to send email
        from non-Exchange system to Exchange. I am testing SolarWinds Network
        Monitoring and I wanted to sent alerts to Exchange. With the SMTP server
        didn’t work, the messages were stuck in the queue folder. I ended up
        setting the FQDN of a Client Access Server as SMTP server for sending
        alerts from SolarWinds and it worked.It is interesting why the messages were stuck in the queue.

        • japinator

          I believe the problem was due to DNS. If the SMTP Server processes the message but cannot deliver it immediately it places the message in the Queue folder. In any case, I am glad you found a solution. :)

  • dan

    I don’t normally comment on posts like this, but this time I must say thanks. Complete, accurate and making a MS admin task look easy!
    That takes some doing. You should write the windows manual!

    • japinator

      Hi Dan, thanks for your kind comments. I am very glad to hear that the guide helped you achieve the desired result.

  • Jovan

    Hi , everything workd like it shold be , but how can i see when peopel send mail to my domain ?

    • japinator

      Hi, the SMTP Server sends/routes mail and is not designed to receive mail. If you want to receive mail to your domain you should setup a server capable of receiving mail such as a POP, IMAP or Exchange Server.

  • Mateen

    hello, i have followed each and every step as its shown. but the email.vbs
    file when opened gives me the error as below.
    The pickup directory path is
    required and was not specified,
    and if i copt the text file in the pickup
    folder, even then i dont get the email.
    kindly help me folks.

    • japinator

      Hi, open the command prompt and run the following command:

      C:inetpubAdminScriptsadsutil.vbs enum /Smtpsvc/1

      Does it return any results? If so then scroll down to the “PickupDirectory” property and state what appears to the right of it.

  • Chris

    This tutorial is EXTREMELY well done. I have never setup an SMTP server before and it worked the very first time. Great work.

    • japinator

      Hi Chris, glad to hear that the steps helped.

  • Bryan Palmer

    This is fantastic!!!

    Thank you so much, I have never set up an smtp server before and this was an immense help thank you

    • japinator

      No problem Sir. Happy that the guide helped you.

  • Dreux Doty

    This is simply fantastic! Easy, peasy, mac&cheesy…I concur with all other praises in the previous comments…The only addition I’d offer you make is to have a “contribution” link somewhere…:)

    • japinator

      Hi, thanks for the feedback, am glad it made the setup easy! Please could you elaborate on what you mean by a contribution link? Happy to do it if it benefits readers/visitors.

      • Dreux Doty

        My apologies for the confusion…I meant a “contribution link” to your paypal account (i.e. I’d be MORE than willing to contribute some funds to you for taking the time to publish this VERY helpful information!)

        • japinator

          Thanks for the suggestion, I may add that in the future. In the meantime, your gratitude and kind comments are sufficient payment :)

  • John Alexis Consorte

    your really great men. you made the windows smtp server deploying more convenient and easy to use. Thanks!

  • Tree Man

    Ok, it works great in test, but how can I allow my terminal server users to use this for outgoing mail only? I have the ability to make a “send to” link in IE and Office apps (actually, using PWB, an IE hack) but I don’t know what executable to point it to for sending via the SMTP server.

    • japinator

      Hi, you can’t point to the executable directly as stmpsvc.dll runs in-process within inetinfo.exe process. Simply point your code to the IP of the SMTP server using port 25. The SMTP server listens on its configured IP and port and will forward on mail that it receives subject to its configured settings.

      • Tree Man

        When you say “point your code at the IP and port” we’re talking about Office apps and anything that has a “send file as” on the File menu. How do I configure that?

        • japinator

          My reference to pointing code at an IP and port was based on my assumption that you were using ASP.NET to send messages. I don’t know what the “send to” link you referred to is using to send mail but I am assuming it uses a mail client of some sort. So if it is using Outlook then update the outlook settings to point to the SMTP Server’s IP address. If your users are already using Outlook for company mail then this won’t work. Alternatively use an executable that can send mail such as Blat.

  • honlue

    i setup every thhing well, i copied the txt file and changed the sending from email to honlue@furthermarket.com and the to email to honlue@gmail.com, note that the honlue@furthermarket.com does not exit on my domain but the to email exist. the message is not delevered but they are enteries created in the qeue directory each time i try to send, another thing is that my mail.furthermarket.com is another smtp server that i purchassed from a vendor, i wanted to do one myself so in the FQDN, i entered localhost. Please urgently need assistance

    • japinator

      Hi Honlue, if messages are in the queue folder then they are still being processed. They will remain there until the number of retries has been exceed after which they will be moved ot the Badmail folder. By now, they will either have been delivered successfully or failed. If they failed, then the reason for the failure will appear in message in the Badmail folder. What errors do you see? I suspect the issue is DNS related because Gmail will perform a reverse DNS lookup of your SMTP server’s public IP and it will fail as you have set your FQDN as localhost.

  • Abdou Motrani

    thank you so much for that tuto
    but, can i use it to send over than 250.000 email (using “mass sender”) with inbox result ?? im wait for your reply :)

    • japinator

      Yes, it can handle that many messages. For high availability you can cluster the SMTP service – I have seen this setup used many times and it works. However, I would suggest an alternative – offloading those messages to a 3rd party mail host such as Mailgun, Sendgrid or Socketlabs. They can guarantee delivery and save you the hassle of administering your own SMTP server.

      • Abdou Motrani

        possible explanation well how to use these sites I’ve noticed that they are not free

        • japinator

          You use the smart host setting in the SMTP server properties to forward emails onto those providers or your application can also connect to them directly over HTTP. Those providers are not free but they ensure your email gets delivered. When you setup your own SMTP server some mail hosts may reject your connections due to security if they think you are a spammer or you don’t have rDNS setup or because you aren’t on a white list. There a whole host of problems you could encounter. If that bulk email you want to send is business critical your time and money might be better spent on one of those previously mentioned providers.

  • Pingback: SMTP Virtual Server relays router email | oneil's blog

  • gourish

    Hi,
    I have configured as instructions are given. But I am not able to understand is which mail ID do i need to configure for this? bcz i have hosted mail service office 365 . do i need to give a office 365 mail ID or I can give any mail like new creation of mail ID? pls help me on this. I am not getting from which id i have to send mails and to which id i need to receive mails.

    Thanks in advance.

    • japinator

      The SMTP service should be used to deliver messages generated by your applications, The from address can be any address from your domain or your Office 365 address. Obviously it would be better if the address actually exists so that if anyone replies to the messages they can be received and read accordingly. The to address must be a valid address so that it is delivered successfully.

  • pratik

    thanks simple, short and accurate info.

    • japinator

      No problem :)

  • Pingback: Relay your home router’s email with a SMTP server | oneil's blog

  • brendon

    I have followed these steps but the email gets sent to the badmail folder. What would likely be prevent the email from getting sent?

    • brendon

      The error report shows: Unable to deliver this message because the follow error was encountered: “Error is processing file in pickup directory.”.

      The specific error code was 0xC00402CE.

    • japinator

      Hi Brendon, hopefully you have resolved this issue by now. If not, then the first question I would ask is, do the emails eventually end up in the Badmail folder? If so, when you open those messages up what errors do you see? Also, have you setup the PTR record?

  • Pingback: Setup and Configure SMTP Server on Windows Server 2008 R2 | SharePoint interests

  • Pingback: Setup and Configure SMTP Server on Windows Server 2008 R2 | RickPham's Stash

  • merums merums

    Thanks for the great article. I did setup and able to send emails to others. Like you mentioned I used the text file and pasted in pickup folder. Lets say i want to receive emails. What should I do?. In my godaddy I added a “A” record as “mail” and points to “123.123.123.3″ my smtp server. Then in MX section for “@” i gave mail.mydomain.com. Now if I send some mails to user@mydomain.com. Should I get that mail in drop folder or any other folder ?

    • japinator

      Hi, the first thing I will say is that IIS SMTP server is not designed to service end users with mail, it is for forwarding/delivering mail therefore this is not a configuration I recommend. However, technically speaking it can work. Your DNS settings are correct, if you want to be able to receive mail, make sure the MX record with a priority of 0 is smtp.yourdomain.com and delete the other one with a priority of 10. Also, make sure that the Connection setting (see step 15 above) is configured to be “All except the below” and remove 127.0.0.1 – this means anyone can connect to your server. This is necessary if you want to receive email from anyone on the internet. Then stop and restart the SMTP service. After this point any mail sent to yourdomain.com should appear in the Drop folder.

      I will say that this is only a half solution, because mail will be delivered to your mail server but you will still need to install a POP3 service to enable mail pickup for your users. You can install Visendo SMTP extender to enable this.

      If you want to run a proper mail server for your domain I recommend using Hmailserver which is a free and fully featured POP3/IMAP server.

  • Al Rashid

    Saved my big time, thanks a lot.

    • japinator

      Happy to hear the positive outcome.

  • siva kumar

    i had problem with this..can you guys help me??

    • siva kumar

      Hi anyone can troubleshoot my prob?

      • japinator

        Hi, what is the problem you are experiencing? You have not provided any information so I can’t help unless you give me some clues.

        • ANonymous

          Hi, I wanted to sent an outgoing email through my web application. I had configure SMTP server accordingly using GMAIL and its works for a testing mail but my web application not able to send the email out. Is there any other SMTP setting I need to do in my Web application?

          • japinator

            The fact that testing works ok means that your SMTP Server config is fine. Your application must point to the SMTP Server. Within the application you configure the IP or host name and port of the SMTP Server and it will send messages to the SMTP server to route appropriately. A quick Google search on sending mail via asp.net or php will get you the results you need.

  • rohit

    Thanks a ton….its working

    • japinator

      Good news, glad it worked :)