Configuring Office365 smtp on ASP.NET 1.1 web applications

If you are still having that frustrating exception “The transport failed to connect to the server” while trying to use an Office365 smtp server settings with ASP.NET 1.1 websites or web applications, then here is the quick fix.

SmtpMail.SmtpServer = pod0000.outlook.com; //your smtp server
webMail.Fields.Add(“http://schemas.microsoft.com/cdo/configuration/sendusing”,”2″);
webMail.Fields.Add(“http://schemas.microsoft.com/cdo/configuration/smtpauthenticate”, “1″);
webMail.Fields.Add(“http://schemas.microsoft.com/cdo/configuration/sendusername”, myusername@email.com);
webMail.Fields.Add(“http://schemas.microsoft.com/cdo/configuration/sendpassword”, mypassword);
webMail.Fields.Add(“http://schemas.microsoft.com/cdo/configuration/smtpserverport”, 25); //the confusing part is here
webMail.Fields.Add(“http://schemas.microsoft.com/cdo/configuration/smtpusessl”,”true”);

We know that Office365 uses SSL and the port should be 587 (or 465 in some cases) but unfortunately for some reason 587 port does not work in ASP.NET 1.1 when using CDONTS. So just plain luck, tried port 25 and the emails went through. This scenario only applies to ASP.NET 1.1 whereas ASP.NET 2.0 or later work fine with 587 port.

Handler Mappings for ActiveReports 3.0 on IIS7

If you are still facing that 404 – File Not Found exception when trying to open an ActiveReport in a ASP.NET 2.0 integrated website in a IIS7 hosting, then try the following mappings  – tried and verified -

<system.web>
…..
…..
<httpHandlers>
      <add verb=”*” path=”*.rpx” type=”DataDynamics.ActiveReports.Web.Handlers.RpxHandler, ActiveReports.Web, Version=5.3.1436.1, Culture=neutral, PublicKeyToken=cc4967777c49a3ff” />
      <add verb=”*” path=”*.ActiveReport” type=”DataDynamics.ActiveReports.Web.Handlers.CompiledReportHandler, ActiveReports.Web, Version=5.3.1436.1, Culture=neutral, PublicKeyToken=cc4967777c49a3ff” />
      <add verb=”*” path=”*.ArCacheItem” type=”DataDynamics.ActiveReports.Web.Handlers.WebCacheAccessHandler, ActiveReports.Web, Version=5.3.1436.1, Culture=neutral, PublicKeyToken=cc4967777c49a3ff” />
</httpHandlers>
…..
…..

<system.webServer>
…..
…..
<handlers accessPolicy=”Read, Execute, Script”>
      <add name=”ActiveReports RPX Handler” path=”*.rpx” verb=”*” type=”DataDynamics.ActiveReports.Web.Handlers.RpxHandler” resourceType=”Unspecified” requireAccess=”Script” />
      <add name=”ActiveReports WebCache Handler” path=”*.ArCacheItem” verb=”*” type=”DataDynamics.ActiveReports.Web.Handlers.WebCacheAccessHandler” resourceType=”Unspecified” requireAccess=”Script” />
      <add name=”ActiveReports Compiled Report Handler” path=”*.ActiveReport” verb=”*” type=”DataDynamics.ActiveReports.Web.Handlers.CompiledReportHandler” resourceType=”Unspecified” requireAccess=”Script” />
</handlers>

Delete IIS logs via PowerShell

My dedicated server had occupied up to 5GB space on C drive through IIS log files. Very worrying when 10+ GB is taken by Windows Server and other 4GB taken by SQL Server and Office files.

The solution to this problem was to delete older logs, i.e. older than 30 days. To filter and delete based on this requirement PowerShell was the right tool. Below is the script I used to delete these logs. You can replace the number ’30′ with your own value and replace the directory location of inetpub log files if different.

get-childitem -Path C:\inetpub\logs\LogFiles\w3svc1 -recurse | where-object {$_.lastwritetime -lt (get-date).addDays(-30)} | Foreach-Object { del $_.FullName }

IIS Website Session Timeout

Windows Featured ImageWhile working on the website users often encounter a Session Timeout error.

Cause

Website picks up the session timeout settings from IIS.

Resolution

The default session time-out setting on IIS is 20 minutes but it can be increased to a maximum of 24 hours or 1440 minutes. See Microsoft article Q233477 for details about increasing the timeout in IIS.

Web servers maintain session state for a fixed time period to preserve Web server resources and as a security precaution. The default setting for IIS is 20 minutes. Do not remove this timeout.

Increasing this value improves usability, preventing users from having to enter their credentials too frequently.

Decreasing this value improves security; if a user leaves his desk unattended with the website application, other users can launch applications using the account. The session time out acts as an idle time out and prevents this type of abuse.

1. Select Default Web Site > Properties > Home Directory > Application Settings > Configuration > Options.

2. Enable the session state time-out and set the Session timeout for 60 minutes.

 Website Application Session

3. Select Application Pools > DefaultAppPool > Properties.

4. From the Performance tab under Idle timeout, set Shutdown worker processes after being idle for a value higher than 20.

 Default App Pool properties

The default session time-out setting on IIS is 20 minutes but it can be increased to a maximum of 24 hours or 1440 minutes. See Microsoft article Q233477 for details about increasing the timeout in IIS.

ASP.NET ‘Sys.Extended.UI’ is null or not an object error using AjaxControlToolkit

To resolve this issue simply add CombineScripts=”false” to the AjaxToolkitManager tag,

<asp:ToolkitScriptManager ID=”ToolkitScriptManager1″ runat=”server” CombineScripts=”false” ></asp:ToolkitScriptManager>

ASP.NET 'Sys.Extended.UI' is null or not an object error using AjaxControlToolkit

To resolve this issue simply add CombineScripts=”false” to the AjaxToolkitManager tag,

<asp:ToolkitScriptManager ID=”ToolkitScriptManager1″ runat=”server” CombineScripts=”false” ></asp:ToolkitScriptManager>

Server Certificate button disabled in IIS Directory Security

Due to some reason my Server Certificate button got disabled in IIS.
After some research here is the fix I got,

http://support.microsoft.com/?id=306667

Follow these steps to reregister the controls:
Click Start, click Run, and then type the following in the text box and hit enter.

Run text 1:
regsvr32 c:\windows\system32\xenroll.dll

Run text 2:
regsvr32 c:\windows\system32\inetsrv\certmap.ocx

Run text 3:
regsvr32 c:\windows\system32\inetsrv\certwiz.ocx

(where c:\windows is your OS directory)

Close the IIS Properties window, and then open the Web site properties. Verify that you can create a certificate request.

Running 32bit ASP.NET 1.1 applications on 64 bit Windows OS

Had an unsual issue today. I was unable to run my older ASP.NET 1.1 apps on a new 64 bit Windows server. Could not restart the IIS web site service. Kept on getting these two issues in the Event Log,

 

Issue #1:

ISAPI Filter ‘c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet_filter.dll’ could not be loaded due to a configuration problem. The current configuration only supports loading images built for a AMD64 processor architecture. The data field contains the error number. To learn more about this issue, including how to troubleshooting this kind of processor architecture mismatch error, see http://go.microsoft.com/fwlink/?LinkId=29349.
[the link takes you no where]
IIS 32bit ISAPI filter issue

Issue #2:

Could not load all ISAPI filters for site/service. Therefore startup aborted.
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.”
Trying to find a solution, I kept bouncing to the page
How to switch between the 32-bit versions of ASP.NET 1.1 on a 64-bit version of Windows
http://support.microsoft.com/default…b;en-us;894435

Finally I resolved the issue. The following steps will give you a better idea on how to resolve this cracker.

1. Goto your Inetpub folder and browse AdminScripts folder
2. Look for adsutil.vbs and double click it. It would ask if you wanted to enable cscript. Say yes and move forward.
3. Click Start>Run and type cmd to open the Command Window
4. Now type the following command to enable the 32-bit mode:

cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1
(here replace systemdrive with the drive letter, i.e. C: or D:)

5. Now install .NET 1.1 Framework. If already installed then using the command window type the following:
%SYSTEMROOT%\Microsoft.NET\Framework\v1.1.4322\aspnet_regiis.exe -i
(systemroot is your windows path, i.e. c:/windows or d:/windows)

6. Make sure that the status of ASP.NET version 1.1.4322 is set to Allowed in the Web service extension list in IIS Manager.

After all is done, right click the Web Sites folder in IIS Manager and click on properties.

IIS5 Isolation mode

In the Services tab make sure Isolation mode is unchecked.

or using the command window type the following,

CSCRIPT %SYSTEMDRIVE%\Inetpub\AdminScripts\adsutil.vbs SET W3SVC/IIs5IsolationModeEnabled 0
NET STOP HttpFilter /y
NET START W3SVC

For more understanding of similar issues visit the following links
http://blogs.msdn.com/david.wang/archive/2005/12/14/HOWTO-Diagnose-one-cause-of-W3SVC-failing-to-start-with-Win32-Error-193-on-64bit-Windows.aspx

http://www.vbforums.com/showthread.php?t=348106

Do let me know what you think about this post.

Follow

Get every new post delivered to your Inbox.