做了一个网站,一切都弄好了
就是找回密码(PasswordRecovery)的功能总是出错
提示:invalid character in mail header
谁能告诉我这个东西到底怎么设置啊?都用设置那些东西?
如能解决我将所有分贡献,
谢谢大家帮个忙!

解决方案 »

  1.   

    提示:invalid character in mail header
    mail头里的无效字符?
    是不是地址不正确。
      

  2.   

    你是通过Url吧,一定是通过URL传递了希奇古怪的字符。建议在拼url之前,先作urlencode。
    有空来欢迎你和你的朋友来我的博客看看,交流交流:http://blog.csdn.net/aafshzj/。
      

  3.   

    就是使用.net 2.0的控件PasswordRecovery
    aspnetdb数据库的其它使用(用户注册,登录)等一切正常
    但是使用这个控件找回密码总是出问题
    下面是出错页面:
    Server Error in '/WebSite8' Application.
    --------------------------------------------------------------------------------An invalid character was found in the mail header. 
    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: An invalid character was found in the mail header.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: An invalid character was found in the mail header.]
       System.Net.BufferBuilder.Append(String value, Int32 offset, Int32 count) +144
       System.Net.Mail.EHelloCommand.PrepareCommand(SmtpConnection conn, String domain) +82
       System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) +790
       System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) +265
       System.Net.Mail.SmtpClient.GetConnection() +43 我的设置是;
    ------------------------------------------web.config-------------------------------
    ....
    <system.net>
    <mailSettings>
    <smtp from="[email protected]">
        <network host="smtp.google.com" password="" userName="" />
       </smtp>
    </mailSettings>
    </system.net>
    ...
    ------------------------passwordRecovery.aspx-------------------------------
    ......
    <asp:PasswordRecovery ID="PasswordRecovery1" runat="server">
            <MailDefinition From="[email protected]" IsBodyHtml="True" Priority="High"
                Subject="Your new, temporary password.">
            </MailDefinition>
    </asp:PasswordRecovery>
    .....
      

  4.   

    我用的是gmail的smtp服务器
    自己的调出来也是这个错误
      

  5.   

    Email 里有非法字符?是不是[email protected]这个地址不规范
      

  6.   

    invalid character in mail header
    提示在mail头中包含非法字符
    你转换成base64,看看
      

  7.   

    mike.d.1984
    这个不是合法的地址吧
      

  8.   

    可是我用过这样的邮件地址还是不行:
    [email protected]
    是不是这个控件本身还有什么没有设置正确的?
      

  9.   

    http://dotnet.blyct.com/QuickStartv20/aspnet/doc/ctrlref/login/passwordrecovery.aspx
      

  10.   

    Re:
    invalid character in mail header
    提示在mail头中包含非法字符
    你转换成base64,看看是这样的,我直接用的控件,基本上一行代码都没有写,只是在属性里设置了一下
    是不是这个控件的使用还有什么先决条件
      

  11.   

    invalid character in mail header邮件头呀,看看邮件头都需要设置一些什么,再把你的邮件头打出来看看,哪个地方不对。
      

  12.   

    <asp:PasswordRecovery ID="PasswordRecovery1" runat="server" AnswerLabelText="答案:"
            AnswerRequiredErrorMessage="必须填写答案" GeneralFailureText="对不起,操作失败.." QuestionFailureText="您的答案不正确,请重试..."
            QuestionInstructionText="回答下面问题取得密码:" QuestionLabelText="问题:" QuestionTitleText=""
            SubmitButtonText="提交" SuccessText="您的密码已发至您的邮箱.." UserNameFailureText="您输入的用户名不存 在..." UserNameLabelText="用户名:" UserNameRequiredErrorMessage="必须填写用户名:"
             Width="380px" UserNameInstructionText="输入您的用户名:" UserNameTitleText="找回密码" MailDefinition-From="[email protected]" MailDefinition-IsBodyHtml="true" MailDefinition-Priority="High" MailDefinition-Subject="您的新密码">
            <MailDefinition From="[email protected]" Priority="High" Subject="您要找的密码..">
            </MailDefinition>
        </asp:PasswordRecovery>
      

  13.   

    就是使用.net 2.0的控件PasswordRecovery
    aspnetdb数据库的其它使用(用户注册,登录)等一切正常
    但是使用这个控件找回密码总是出问题
    下面是出错页面:
    Server Error in '/WebSite8' Application.
    --------------------------------------------------------------------------------An invalid character was found in the mail header. 
    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: An invalid character was found in the mail header.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: An invalid character was found in the mail header.]
       System.Net.BufferBuilder.Append(String value, Int32 offset, Int32 count) +144
       System.Net.Mail.EHelloCommand.PrepareCommand(SmtpConnection conn, String domain) +82
       System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) +790
       System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) +265
       System.Net.Mail.SmtpClient.GetConnection() +43 我的设置是;
    ------------------------------------------web.config-------------------------------
    ....
    <system.net>
    <mailSettings>
    <smtp from="[email protected]">
        <network host="smtp.google.com" password="" userName="" />
       </smtp>
    </mailSettings>
    </system.net>
    ...
    ------------------------passwordRecovery.aspx-------------------------------
    ......
    <asp:PasswordRecovery ID="PasswordRecovery1" runat="server">
            <MailDefinition From="[email protected]" IsBodyHtml="True" Priority="High"
                Subject="Your new, temporary password.">
            </MailDefinition>
    </asp:PasswordRecovery>
    .....
      

  14.   

    是不是你机器上的SMTP的问题呀!!!
      

  15.   

    1.我用的是外面的smtp服务器
      就不用自己的了吧
    2.楼上的能说得详细一点怎么把url编码格式转回去
      我觉得也是这个问题好像