帮助使用 ASP.NET 密码恢复
我正在尝试使用 asp.net 3.5 提供的密码恢复控件,当用户按下提交时出现此错误:
Microsoft JScript runtime error:
Sys.WebForms.PageRequestManagerServerErrorException:
The specified string is not in the form required for an e-mail address.
我确信用户(需要密码恢复)的电子邮件地址是正确的([电子邮件受保护])。
我也确信 web.config 中的 smtp 设置是正确的。发件人的电子邮件格式为 [电子邮件受保护]
那么我做错了什么?我不知道从哪里开始调试才能找到问题!
i am trying to use the password recovery control provided by asp.net 3.5 and i get this error when the user presses submit :
Microsoft JScript runtime error:
Sys.WebForms.PageRequestManagerServerErrorException:
The specified string is not in the form required for an e-mail address.
i am sure that the email address of the user (who needs pass recovery) is correct ([email protected]).
and i am also sure that my smtp settings in web.config are correct. The email of the sender is in the form of [email protected]
so what am i doing wrong? i don't know where to start debugging so i can find the problem!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您能否调试并给出传递给
Send
函数的参数? (更准确地说是From
和To
参数)问题很可能出在这两个参数之一。有关 MailAddress 类的文档,请参阅此 。
Could you debug and give the parameters you are passing to the
Send
function? (more exactly theFrom
andTo
parameters) Most likely the problem is in one of those 2 parameters.For documentation regarding the MailAddress class see this.
错误消息可能说的是实话,理想情况下,您可以在“最后”阶段获得一些输出 - 就在错误发生之前。可能是您不小心在开头添加了“mailto:”,或者前后有空格,或者换行符,或者类似的东西。
如果您可以发布确切的输出,并用引号或括号括起来,以查看之前或之后是否有空格,那么问题是什么应该很明显 - 否则请对此答案发表评论,我们将很乐意进一步诊断。
希望有帮助!
The error message is probably telling the truth, ideally get some output at the 'most final' stage you can - right before the error occurs. It could be you've accidentally added 'mailto:' at the beginning, or there's a space before or after, or a newline, or something like that.
If you could post the exact output, surrounded by quotes or brackets to see if there is whitespace before or after, it should become obvious what the problem is - else please post a comment to this answer and we will be happy to diagnose further.
Hope that helps!