IT Nota

  • Home
  • How To
  • .NET
  • WordPress
  • Contact

How to Install SMTP Server on Windows Server 2012 R2

The internal SMTP server feature is deprecated but not removed on Microsoft Windows Server 2012, so when moving legacy applications from an older server, you can still install the internal SMTP under IIS 6 on Windows Server 2012 R2 to avoid using a separate Exchange Server. Here are the steps to install it.

Steps

  1. Launch Server Manager.

  2. On the Dashboard, click Add roles and features on the right pane.

    Server Manager Dashboard on Windows Server 2012 R2

  3. Click Next > button to go to Installation Type (on left) and select Role-based or feature-based installation on the right and click Features on the left.

  4. In a box under the heading Features, check SMTP Server. There will be a pop-out screen to add more services or features. Just click the Add Features button.

    Add SMTP features on Windows Server 2012 R2

    Add features required for SMTP on Windows Server 2012 R2

  5. You will be shown a confirmation screen. Click the Install button. Click Close button when finished.

  6. You can find the IIS 6 by going to the tile menu and pick the icon with the purple background as pictured.

    IIS 6 on Windows Server 2012 R2

  7. Launch the IIS 6 Manager to configure the SMTP server.

    IIS 6 Manager on Windows Server 2012 R2

The default location of your SMTP folders will be in C:\inetpub\mailroot. You can move these default directories to a different drive.

Further Reading

Features Removed or Deprecated in Windows Server 2012 R2
How to Fix SMTP 550 5.7.1 Unable to Relay Error on Windows Server 2012 R2
Mastering Windows Server 2012 R2
Windows Server 2012 R2 Inside Out Volume 1: Configuration, Storage, & Essentials
Windows Server 2012 R2 Inside Out Volume 2: Services, Security, & Infrastructure
Training Guide Installing and Configuring Windows Server 2012 R2 (MCSA)

January 14, 2015 Filed Under: How To Tagged With: IIS, Internet Information Services, Microsoft, Simple Mail Transfer Protocol, Smtp Server, Windows Server

How to Use CDONTS.DLL on Windows Server 2012 R2

With Microsoft ending the support on Windows 2003, many classic ASP applications that use cdonts.dll to send automatic emails (cdonts.newmail) still need to be migrated to the newer server (Windows Server 2012 R2). One way you can tell an application is using it is when you encounter the following error message on your browser.

CDONTS.NEWMAIL ActiveX error

CDONTS was already deprecated since Window 2000 and completely removed in Windows 2003. The ideal way to do it is to use the newer and more robust cdosys.dll. But in practicality, this will require a code re-write and many companies with legacy applications just don’t want to spend the time or money to do so. So you just to move all the codes and make them work the same way on Windows Server 2012 R2 which is 64-bit only.

Here are the steps to make cdonts.dll work on the current Windows Server 2012 R2. Please note, that the DLL itself is no longer available on the server as it is replaced with cdosys.dll. You also need to install an internal SMTP server first prior to performing these steps below or else you won’t be able to configure the permission on the mail pickup directory (Step 4).

Steps

  1. Copy CDONTS.DLL from the old server Windows Server 2003 (C:\WINNT\system32).

    CDONTS.DLL on Windows Server 2003

  2. Paste the DLL to the Windows Server 2012 R2 (C:\Windows\SysWOW64).

    CDONTS.DLL copied to Windows Server 2012 R2

  3. Launch Command Prompt (Admin) and type regsvr32 C:\Windows\SysWOW64\cdonts.dll

    Register cdonts.dll on Windows Server 2012 R2's command prompt

  4. Grant the required permissions on C:\inetpub\mailroot\pickup (or whichever mail directory you use if not the default). Typically, at the very least, you want to grant USERS group with Modify permissions.

  5. Reset IIS or restart the server (if not PROD).

  6. Test the application.

One last thing, we noticed that Windows Server 2012 R2 is more restrictive for e-mail formatting. You need to use an FQDN for your From: e-mail address. On Windows 2003, you can use any one-word “address” (i.e., From: “MySender”). On Windows Server 2012 R2, you need to add [email protected]. The e-mail format needs to be valid whether or not the e-mail address itself is legit.

We have used this method to migrate a dozen of ASP applications and this will buy more time for at least another eight more years before we need to re-write most of our applications.

Further Reading

Mastering Windows Server 2019
Mastering Windows Server 2016 Hyper-V

January 12, 2015 Filed Under: How To Tagged With: Cdonts Dll, Classic ASP, Windows 2012, Windows Server

Migrating ASP.NET 1.1 to Windows Server 2012

With Microsoft cutting the support for Windows 2003 by July 2015, many legacy web applications built with .NET Framework 1.1 have to be migrated to a newer Windows Server 2012 R2. The dilemma is that .NET Framework 1.1 is no longer supported (it’s not even possible to manually install the .NET Framework 1.1 on these platforms) on Windows Server 2012 or Windows Server 2012 R2.

The proposed solution by Microsoft is to install the .NET Framework 3.5 SP1 which includes the .NET Framework 2.0. Most ASP.NET 1.1 applications should run under .NET Framework 2.0 without re-compiling or re-writing of codes so long as they don’t have any runtime breaking changes, whether it’s API or behavior.

Further Reading

Breaking Changes in .NET Framework 2.0
List of Breaking Changes
Running .NET Framework 1.1 Apps on Windows 8, Windows 8.1 or Windows 10
Microsoft .NET Framework 1.1 and 2.0 Compatibility
Runtime Breaking Changes

February 8, 2014 Filed Under: .NET Tagged With: ASP.NET, Microsoft, Windows Server

Robocopy Example to Mirror Web Server

Just to solve a challenge of dealing with legacy CMS that’s only specifically mapped to an old server. The contents need to be copied over to a new server periodically throughout the day and it has to act like a mirror (option /mir) in such a way that net new files are copied and any deleted directories and files are also reflected on the new server.

As the server was upgraded, there is a couple files that cannot be overriden. With the use of Windows Robocopy, certain directories such as App_Data and aspnet_client can be excluded (option /xd). In the same way, files like global.asa and web.config (option /xf).

Robocopy command:

robocopy \\shared\d$\itnota\ D:\itnota\ /mir /e /xd "App_Data" "aspnet_client" /xf "global.asa" "web.config" /log:"F:\migration.log"

The command then can be set on a task scheduler to run automatically.

Robocopy commands in Task Scheduler

More Windows Robocopy examples can be found on the links below (Further Reading).

Further Reading

Robocopy
Robocopy and a Few Examples
Robocopy /mir switch doesn’t copy security
MCSA Windows Server 2016 Complete Study Guide: Exam 70-740, Exam 70-741, Exam 70-742 and Composite Upgrade Exam 70-743 2nd Edition

January 29, 2014 Filed Under: How To Tagged With: Task Scheduler, Web Server, Windows Robocopy, Windows Server

How to Fix Access Denied (401) Error in Microsoft IIS

After migrating a web application to a new server, we encountered this server error:

401 - Unauthorized: Access is denied due to invalid credentials. You do not have permision to view this directory or page using the credentials that you supplied.

Server Error 401

This happened despite the fact the user is already authenticated via Active Directory.

There can be many causes to Access Denied error, but if you think you’ve already configured everything correctly from your ASP.NET application, there might be a little detail that’s forgotten. Make sure you give the proper permission to Authenticated Users to access your web application directory.

Right-click on the directory where the web application is stored and select Properties and click on Security tab.

Folder Properties - Security Tab

Click on Edit…, then Add… button. Type in Authenticated Users in the Enter the object names to select.

Adding Authenticated Users

Click OK and you should see Authenticated Users as one of the user names. Give proper permissions on the Permissions for Authenticated Users box on the lower end if they’re not checked already.

Security Permissions for Users

Click OK twice to close the dialog box. It should take effect immediately, but if you want to be sure, you can restart IIS for your web application.

Refresh your browser and it should display the web page now.

Further Reading

How to Use Custom 401 Error Page on IIS
How to Customize 401 Error Page with 302 Redirect on IIS
How to Install IIS on Windows
How to Solve Intermittent 403 Forbidden Access is Denied Error in IIS

October 3, 2013 Filed Under: How To Tagged With: IIS, Internet Information Services, Windows Server

« Previous Page
Buy me a coffee Support this site
Buy Me a Coffee?

Categories

  • .NET
  • Coding
  • Cybersecurity
  • Database
  • How To
  • Internet
  • Multimedia
  • Photography
  • Programming
  • Resources
  • Review
  • Tips and Tricks
  • Uncategorized
  • Use Case
  • WordPress
  • Writing

Recent Posts

  • How to View Stored Procedure Code in SQL Server
  • How to Find a String in SQL Server Stored Procedures
  • How to Remove Cached Credentials without Rebooting Windows
  • ESP Work Automation: Empowering Enterprises with Streamlined Workflows and Operational Efficiency
  • How to Search for a String in All Tables in a Database

Recent Posts

  • How to View Stored Procedure Code in SQL Server
  • How to Find a String in SQL Server Stored Procedures
  • How to Remove Cached Credentials without Rebooting Windows
  • ESP Work Automation: Empowering Enterprises with Streamlined Workflows and Operational Efficiency
  • How to Search for a String in All Tables in a Database

Tags

.NET .NET Core AdSense ASP.NET Cdonts Dll Classic ASP Code Editor ETL FSharp Genesis Framework Git Google HP Asset Manager HTML5 Hugo IIS Information Security Internet Internet Information Services iOS JAMStack Linux macOS Microsoft Microsoft SQL Server MVC PHP PowerShell Python Simple Mail Transfer Protocol Smtp Server SQL SQL Server SSIS SSMS SSRS Sublime Text Visual Studio Visual Studio Code VPN Windows Windows 8 Windows 10 Windows 2012 Windows Server

Copyright © 2011-2025 IT Nota. All rights reserved. Terms of Use | Privacy Policy | Disclosure