views:

164

answers:

1

I am trying to fix the behavior of a CreateUserWizard control in ASP.NET 2.0. With a fairly naive, out-of-the-box implementation, if you enter an email address that does not exist, or there is some other error sending the email, you get a YSOD showing the ugly details of the SMTP error, plus the user account is created anyway. Handling the SendMailError does not seem to help, as it is fired after the user is already created.

Ideally, an email error would cause an "invalid email address" error message (or something to that effect) to be displayed. Seems like this should be pretty easy, but after quite a bit of looking around I haven't found an answer. Anybody have any solutions?

A: 

Hey,

You cannot in that way; you would need to use what most businesses do: send a confirmation email that they must click on in X number of hours, and only then creating the account. THis is a modest change from the way the CUW works, so you'd have to break away somewhat from the base functionality and tap into events to prevent the default functionality for that.

HTH.

Brian
True enough, but how to let the user know that the email could not be sent?
glaxaco
Look at some of the API's out there, like GMAIL, or see if Exchange has the feature, because there isn't an event that fires when the email fails, a delivery failure gets sent back to you, and you would have to process that message to figure that out. That could be days/weeks later, that's the issue.
Brian