How to Test System Generated Emails without Internet in Vista

Recenetly I have to develop a system which generates highly formatted emails. And I decided that I will do that in my home instead of office. After spending some time I figure out a way to do this. I configured IIS server in Windows Vista to save emails in my local drive. and I can see those emails from my outlook express. Here are the details that how to configure IIS:-
1- Run IIS from Start->run->inetmgr
2- Select your PC name from connections pane. and Right Click on SMTP E-Mail in middle pane.

3- In Features screen select Store e-mail in a pickup directory.

4- I have entered D:\Mails in the path.
5- Now goto D:\Mails (or what ever folder you mentioend).
6- When your application sends mail , mails will be saved in that folder with .eml extension. You can view those files with outlook.

7- If still not getting emails in your folder then try to add this line in your code before sending email:-

smtpClient.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis;

How to Auto Refresh / Re Load Page

Sometimes we need a page which shows real time date e.g. Stock exchange, cricket match, etc. To add auto refresh / re load you need to add the following meta tag in your markup's head section.
<meta http-equiv="refresh" content="600">

If you want to add this from code behing, then you can add it like this:-
protected void Page_Load(object sender, EventArgs e)
{
HtmlMeta hmRefresh = new HtmlMeta();
hmRefresh.HttpEquiv = "Refresh";
hmRefresh.Content = "10";//Time in seconds
Page.Header.Controls.Add(hmRefresh);
}

System.UnauthorizedAccessException: Access to the path 'C:\inetpub\wwwroot\...' is denied


This exception is a very common exception. It usually occurs when we move our application to IIS server (usually on production environment).

This exception occurs because IIS uses ASP .Net (IIS_IUser in Vista) user account and ASP .Net is not authorized to access that location.

To give a quick fix to this, follow these steps:-

  1. Give read/write rights to ASP.NET user to C:\Inetpub\yourfolder\ folder:-
    1. Right Click on FOlder and Select Properties
    2. Go to Security Tab
    3. Click Add, then click Location.
    4. Select your pc name, usually first item.
    5. Press Ok, then press advance and then Find Now.
    6. Select ASP.NET user if not exist then select Authenticated Users.
    7. Press Ok. And Select Read/Write/Modify/List Folder Contents.
  2. Go to IIS->WebSites->DefaultWebSite->YourSiteName->Properties, and at Virtual Directory Tab check 'Read' and 'Write' button.

How to Enable Internet Explorer Advance Tab in Vista


Recently my system got crashed and IT guys installed windows Vista on it, by default they have disabled Advance Tab in Tools-> Internet Options. And I was unable to debug Javascript through my Visual Studio.

After searching the net for a while i found a registry key which opens that option:-


Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Control Panel]
"AdvancedTab"=dword:00000000


Save this code as IE.reg and double click on it. After that I was able to view Advance Tab in IE and enabled javascript debugging in IE.

Just for refrence I am adding the path to enable javascript debugging in IE.

Tools-> Internet Options -> Advance -> Check Disable Script debugging (Internet Explorer)

Tools-> Internet Options -> Advance -> Check Disable Script debugging (Others)

Microsoft, Yahoo! Change Search Landscape



Global Deal Creates Better Choice for Consumers and Advertisers


SUNNYVALE, CA and REDMOND, WA - 29 July, 2009 - Yahoo! and Microsoft announced an agreement that will improve the Web search experience for users and advertisers, and deliver sustained innovation to the industry. In simple terms, Microsoft will now power Yahoo! search while Yahoo! will become the exclusive worldwide relationship sales force for both companies' premium search advertisers. More...