You are currently browsing the tag archive for the ‘iis’ tag.
I assume the environment to be Windows 7 Professional, IIS 7. something. This error is caused when the directory browsing feature is disabled and or the default page is not properly set. To sort out this issue go to IIS Manager. Open Directory Browsing.
Now click Enable from the options available on the right side. Restart IIS. Right Click on the App in the Default Websites tree. Click Manage Application , than Browse and Wala. The site will automatically start working. If there is still problems, check the default pages. if you have a default page other than the pages listed in the default page list. Add ur default page and check again. Site will be working.
Sending emails through ASP.Net2.0 is very easy. Just a few lines of code. But when u get an error you will be surprised. So before you write up the few lines of code you have to do the following.
Configure IIS for sending emails. Its simple not a big deal. Check if SMPT is already installed. If not installed than go to Add Remove Windows Components and double click IIS. Click SMTP. Install it and restart your system. Now your local web server is ready for sending emails. The next thing is the coding part.
Add this line of code to the top of the page.
To send an email you need the following parts of an email.
From (address who is sending the email)
To (to whom the emails is being sent)
Subject (subject of the email)
Body (body text of the email)
Write the following code
string strFrom, strTo, strSubject, strBody; strFrom = "firstname.lastname@example.org"; strTo = "rece<a href="mailto:email@example.com">firstname.lastname@example.org</a>"; strSubject = "Test Email"; strBody = "You have a test email."; MailMessage eProEmail = new MailMessage(strFrom, strTo, strSubject, strBody); SmtpClient emailClient = new SmtpClient("localhost"); emailClient.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis; emailClient.Send(eProEmail); emailClient.Timeout = 500;
Run the code and check your email. I hope you will not encounter those errors saying “Mailbox not found” etc etc.