CreateUserWizard FormatException for e-mail address


A

Avi

A CreateUserWizard contorl receives new user details, adds the user to
the database, tries to send a confirmation mail message and stops with
a "System.FormatException: The specified string is not in the form
required for an e-mail address."

Any ideas?

---------------------------------------------------------
The CreateUserWizard contorl's code:

<asp:CreateUserWizard ID="CreateUserWizard1" runat="server"
ContinueDestinationPageUrl="~/Default.aspx">
<WizardSteps>
<asp:CreateUserWizardStep runat="server">
</asp:CreateUserWizardStep>
<asp:CompleteWizardStep runat="server">
</asp:CompleteWizardStep>
</WizardSteps>
<MailDefinition From="ProjectTemplate" Subject="Registration to
ProjectTemplate"
BodyFileName="~/UsersMngmnt/Registration.txt">
</MailDefinition>
</asp:CreateUserWizard>

---------------------------------------------------------
The mail configuration in the parent directory's Config.Web:

<system.net>
<mailSettings>
<smtp from="ProjectTemplate">
<network host="<Outgoing Mail Server>" password="<Password>"
userName="<User Name>" />
</smtp>
</mailSettings>
</system.net>

The network host, password and userName values were taken from
Outlook's E-mail Accounts, so I'm quite sure they're correct.

---------------------------------------------------------
The activity that (consistently) causes the exception:

Click on "Register for the first time".
Receive "Sign Up for Your New Accoutn" step.
Enter User Name "g", Password & Confirm Password "1234567#", E-Mail
"(e-mail address removed)", Security Question "What's your name?" and Security
Answer "g".

---------------------------------------------------------
The exception:

Server Error in '/ProjectTemplate' Application.
--------------------------------------------------------------------------------

The specified string is not in the form required for an e-mail address.

Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.

Exception Details: System.FormatException: The specified string is not
in the form required for an e-mail address.

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.


Stack Trace:


[FormatException: The specified string is not in the form required for
an e-mail address.]
System.Net.Mime.MailBnfHelper.ReadMailAddress(String data, Int32&
offset, String& displayName) +1311
System.Net.Mail.MailAddress.ParseValue(String address) +417
System.Net.Mail.MailAddress..ctor(String address, String
displayName, Encoding displayNameEncoding) +264
System.Net.Mail.MailAddress..ctor(String address) +33
System.Net.Mail.Message..ctor(String from, String to) +447
System.Net.Mail.MailMessage..ctor(String from, String to) +458
System.Web.UI.WebControls.MailDefinition.CreateMailMessage(String
recipients, IDictionary replacements, String body, Control owner) +1588
System.Web.UI.WebControls.MailDefinition.CreateMailMessage(String
recipients, IDictionary replacements, Control owner) +310
System.Web.UI.WebControls.LoginUtil.CreateMailMessage(String email,
String userName, String password, MailDefinition mailDefinition, String
defaultBody, Control owner) +215
System.Web.UI.WebControls.LoginUtil.SendPasswordMail(String email,
String userName, String password, MailDefinition mailDefinition, String
defaultSubject, String defaultBody, OnSendingMailDelegate
onSendingMailDelegate, OnSendMailErrorDelegate onSendMailErrorDelegate,
Control owner) +482
System.Web.UI.WebControls.CreateUserWizard.AttemptCreateUser() +641

System.Web.UI.WebControls.CreateUserWizard.OnNextButtonClick(WizardNavigationEventArgs
e) +200
System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source,
EventArgs e) +650
System.Web.UI.WebControls.CreateUserWizard.OnBubbleEvent(Object
source, EventArgs e) +158
System.Web.UI.WebControls.WizardChildTable.OnBubbleEvent(Object
source, EventArgs args) +39
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs
args) +56
System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +107
System.Web.UI.WebControls.Button.RaisePostBackEvent(String
eventArgument) +178

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) +31
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +32
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
+72
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
+3838
 
Ad

Advertisements

Joined
Nov 16, 2006
Messages
1
Reaction score
0
RE:CreateUserWizard FormatException for e-mail address

<MailDefinition From="ProjectTemplate" Subject="Registration to
ProjectTemplate"
BodyFileName="~/UsersMngmnt/Registration.txt">
</MailDefinition>

The "From" attribute should be a valid email address (e.g. (e-mail address removed))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top