Dim aMsg As New MailMessage()
                aMsg.From = "[email protected]"
                aMsg.To = sendob
                aMsg.Subject = "找回的密码"
                aMsg.Body = "你好,你的Mcrm操作员帐号是:" & Request("hideuser") & ",密码是:" & pwd & ",请你牢记!"
                Dim SmtpMail As System.Web.Mail.SmtpMail
                SmtpMail.SmtpServer = "192.168.0.1"
                SmtpMail.Send(aMsg)
                Response.Redirect("../cominfo.aspx?info=密码邮件已发到你的email:" & sendob & "中,请查收!")

解决方案 »

  1.   

    我还想问一下,SmtpMail.SmtpServer = "192.168.0.1"是根据什么来设置的,我用的是XP,应该怎么做呢?
      

  2.   

    就是邮件服务器的IP地址。和你用XP没有关系。
      

  3.   

    是这样的,我学习写的一个代码,要它能正常用起来,如果这个不对就不行呀,我用的是163.com的嘛,我用ping stmp.163.com得到一个IP为202.108.44.203,可是出错,报错如下:服务器拒绝了发件人地址。服务器响应为: 553 You are not authorized to send mail as <MAIL FROM: <[email protected]>>, authentication is required 
    说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.Runtime.InteropServices.COMException: 服务器拒绝了发件人地址。服务器响应为: 553 You are not authorized to send mail as <MAIL FROM: <[email protected]>>, authentication is required 源错误: 
    行 33: 
    行 34:  //发送电子邮件
    行 35:  SmtpMail.Send(NewMail);
    行 36: 
    行 37:  Message.Text = "发送成功";
     源文件: D:\ASP.NET代码\电子邮件\EmailLog.aspx    行: 35不知道是我哪里没有搞明白,谢谢!
      

  4.   

    1、有没有装smtp服务组件。
    2、SmtpMail.SmtpServer就是你服务起的ip罗。