When Written:
The other day I had to move a number of websites from an old Windows 2003 server to a ‘new’ 2012R2 server. This meant that the web service changed from IIS6 to IIS8.
The migration went well and before things went live I tested the ASP pages that were written to send emails via CDOSYS, I thought I would write about my experience here just in case it helps anyone.
First the SMTP service is not installed by default with 2012 but it is a simple enough job of adding this via the setup later if necessary. In IIS7/8 you then have an SMTP option in the management tool.
The next screen gives you two choices of how to deliver your email from your website pages. I prefer to use the second option of storing the e-mails in the pickup directory. This way you can see what is happening to the emails and this can help a lot in the diagnostics:
Now you need to find ( or possibly install ) IIS6 management tool as this will enable you to set up the SMTP service. Although you can setup a virtual SMTP for each website, this is a bit pointless because of a major bug with the Microsoft SMTP server. This bug means that all emails are sent out from the default IP address of the server. So it doesn’t matter if each website has its own IP address, emails will still appear to have been relayed through the default IP address. This could case the emails to be blocked so it is important to make sure the DNS SPF record allows this domain to relay through this IP address. You still should add domain aliases to the SMTP service so that the domain is included in the email header. In days gone by you could avoid all this but email servers have become much more stringent on what they allow through.
The mails should go into the ‘pickup’ folder and then move to the ‘queue’ folder to be delivered although this can be so quick that you are not aware of things. If the email can not be delivered then it will after a while appear in the ‘BadMail’ folder. One issue I had was emails to a certain domain were appearing in the ‘drop’ folder, this folder is for emails that are destined for a local domain. On my set up this was caused by the incorrect order of the multiple DNS servers bound to the network card, investigating the SMTP server log files revealed what was happening.
I hope this all helps someone. We can but hope that Microsoft include a more grown up SMTP service that will work with legacy ASP pages as well as .NET. The real world means that there often isn’t the budget or skills to rewrite a web site for new technology just because the OS vendor decides it wants to change / remove functionality.
Article by: Mark Newton
Published in: Mark Newton