More cool email stuff - .Net forms authentication
While killing time, I built a web app for our practice area at work. I especially enjoyed using forms authentication, and got to work with the really nice built-in login controls in .Net, including the ASPNETDB. (Geezsh Microsoft seems as if they're bombarding us with these databases- ASPNETDB, ASPSTATE, ASPNETFORUMS, etc.. Why don't they just include them as "system" databases from the gitgo in SQL 2005/08?). Anyway, the forms controls are really neat, and the database is very extensive. A couple of blogs ago I mentioned the greatness of Google! for sending blind email. Got a ton of responses, mostly negative. Complaints notwithstanding, I wanted to use the same logic for my PasswordRecovery page for my web app. The problem that I ran into was that the OnSendingMail doesn't allow you to specify the value for SSL, which happens to be required for Google! However, the method can be overridden. Niiiiiiiice!
Originally I created a simple function in code-behind; however, even a DBA knows that you don't use code behind like this. So, I built the following class for the override so you can call it from PasswordRecovery.aspx.cs, or wherever else. And it works great! Also not shown is some code in the <appSettings> portion of the web.config file; I simply added a couple of key-value pairs for mail. Hope that you can use this when working with the excellent forms authentication controls.
---------------------
I'll drink to this! And just about anything else, really.
Click here to get the code....
2e436320-98a1-4c19-a823-2bfb6b1b9283|0|.0