M
malhenry
Hi,
I am trying to use aspasswordrecovery and I want to catch
System.Net.Mail.SmtpFailedRecipientException which can happen when someone
enters a bad email address in the membership? database. The email message
containing the new password can not get to the user because of the invalid
email address.
Where can I put the catch logic so that this exception does not blow up my
web app? Or is there another way to handle this situation?
here is the aspx snippet:
<div id="xxx">
<fieldset>
<!-- add H2 here and hide it with css since you can not put h2
inside a legend tag -->
<h2 class="none">
Change Password</h2>
<legend>Change Password</legend>
<aspasswordRecovery ID="PasswordRecovery1" runat="server"
UserNameInstructionText="Enter your User Name to receive your new password
via e-mail.">
</aspasswordRecovery>
</fieldset>
</div>
Here is the code behind:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class zzz : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
// dummy stuff for failed attempt to catch exception
int i;
try
{
i = 5;
}
catch (System.Net.Mail.SmtpFailedRecipientException)
{
i = 6;
}
}
}
Thanks.
I am trying to use aspasswordrecovery and I want to catch
System.Net.Mail.SmtpFailedRecipientException which can happen when someone
enters a bad email address in the membership? database. The email message
containing the new password can not get to the user because of the invalid
email address.
Where can I put the catch logic so that this exception does not blow up my
web app? Or is there another way to handle this situation?
here is the aspx snippet:
<div id="xxx">
<fieldset>
<!-- add H2 here and hide it with css since you can not put h2
inside a legend tag -->
<h2 class="none">
Change Password</h2>
<legend>Change Password</legend>
<aspasswordRecovery ID="PasswordRecovery1" runat="server"
UserNameInstructionText="Enter your User Name to receive your new password
via e-mail.">
</aspasswordRecovery>
</fieldset>
</div>
Here is the code behind:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class zzz : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
// dummy stuff for failed attempt to catch exception
int i;
try
{
i = 5;
}
catch (System.Net.Mail.SmtpFailedRecipientException)
{
i = 6;
}
}
}
Thanks.