Thursday, June 21, 2007

Send an email by GMail from ASP.NET 2.0

If you try to use ChangePassword control with GMail server in your settings, you'll probably get failed. To fix that you need to use SSL to send an email, and also - set SMTP server port to 587.

To use SSL add a handler to SendingMail event of the control with the following body:

protected void _ctrlPasswordRecovery_SendingMail(object sender, MailMessageEventArgs e)

{

        // send the same email, but with SSL enable

    SmtpClient client = new SmtpClient();

    client.EnableSsl = true;

    client.Send(e.Message);

 

        // cancel the sending by control

    e.Cancel = true;

}

Labels: , , , , ,

Sunday, June 17, 2007

Restore IntelliSense for web.config

Sometimes intellisense gets lost for web.config in VS2005.

Seems like it happens after usage of "ASP.NET Configuration" tool. The tool replaces <configuration> tag with <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">, and IntelliSense is not available after that.

To fix the problem - just remove that xmlns="..." from the <configuration> tag. And save the web.config.

 

Labels: , , , , ,

Sunday, June 10, 2007

Fixing Visual Studio 2005 Documentation

Documentation for .NET Framework disappeared after I installed some additional stuff to VS2005 (I guess it was after "Web Client Software Factory - January 2007" installation). On hitting F1 in VS2005 usually I was getting "Information Not Found".

After unsuccessful searches in Google I gave up and decided to try to find the problem myself. That was funny, because I found the solution in a minute.

In case you have the similar problem I would suggest to try the following:

  1. Run Microsoft Visual Studio 2005 Documentation from Start Menu. The Document Exproler should start with the page named The Visual Studio Combined Help Collection.
  2. At the page click on Visual Studio 2005 Combined Help Collection Manager hyperlink. That should go to a page with information on all help collections installed at your machine.
  3. Check all collections you need and hit Update VSCC. Close all instances of Document Explorer and VS2005. On the next start it will update indexes and you should get the help back.

Good luck.

 

del.icio.us tags: , , , , , , , ,

Labels: , , ,