发Email出现错误!!!(在线等)

cwlcwr 2006-03-27 04:48:05

注册

检验没问题后

录入数据库;
try{
SM.AdminEmail="000@000.net.cn";
SM.UserName="000@000.net.cn";
SM.Password="000000"; SM.SmtpServer="22.16.120.103";
SM.EMailFormat="Html";
string mailContent=RealName.Text+"你好\r\n你的帐号 :"+UserName.Text+"\r\n你的密码:"+tem.ToString()+"\r\n \r\n\r\n恭喜你成为超 SM.Send(Email.Text.ToString().Trim().Replace(" ",""),"lsb@lsb.net.cn","注册超脑力会员成功!",mailContent);
Response.Write("<script language=\"javascript\">alert('注册用户成功!登陆密码已经发送到您的信箱中,请从首页登陆!');window.location.href='../index.aspx';</script>");
Response.End();

}
catch
结果很多时候EMAIL收不到信
------------------------------
public class SystemMail

{

private string _adminEmail;

private string _smtpServer = "localhost";

private string _password;

private string _userName;

private string _mailFormat;


public SystemMail()

{

}

public string AdminEmail

{

get{return _adminEmail;}

set{_adminEmail = value;}

}

public string SmtpServer

{

get{return _smtpServer;}

set{_smtpServer = value;}

}

public string Password

{

get{return _password;}

set{_password = value;}

}

public string UserName

{

get{return _userName;}

set{_userName = value;}

}

public string EMailFormat

{

get{return _mailFormat;}

set{_mailFormat = value;}

}

public bool Send(string to, string from, string subject, string message)

{

try

{

MailMessage em = new MailMessage();

em.To = to;

em.From = from;

em.Subject = subject;

em.Body = message;

if (this.EMailFormat=="Html")
{
em.BodyFormat=MailFormat.Html;
}



//Found out how to send authenticated email via System.Web.Mail at http://SystemWebMail.com (fact 3.8)

if(this.UserName != null && this.Password != null)

{

em.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); //basic authentication

em.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", this.UserName); //set your username here

em.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", this.Password); //set your password here

}

SmtpMail.SmtpServer = this.SmtpServer;

SmtpMail.Send(em);

return true;

}

catch

{
return false;

}
}
...全文
137 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
cwlcwr 2006-03-28
  • 打赏
  • 举报
回复
up
cwlcwr 2006-03-28
  • 打赏
  • 举报
回复
GO ON
cwlcwr 2006-03-27
  • 打赏
  • 举报
回复
我确认油箱地址OK
shoutor 2006-03-27
  • 打赏
  • 举报
回复
就是邮箱不存在嘛
shadow841112 2006-03-27
  • 打赏
  • 举报
回复
553 #4.1.3 system is busy3
system is busy??
lavery 2006-03-27
  • 打赏
  • 举报
回复
邮箱地址不存在
cwlcwr 2006-03-27
  • 打赏
  • 举报
回复
登陆stmP 邮箱

主题: 邮件投递超时错误
无法将您的邮件投递至以下指定地址:
ccwwllccwwrr@tom.com : 553 #4.1.3 system is busy3


//----------------------------------------------------------
Received: from [208.136.130.103]; Mon, 27 Mar 2006 16:41:42 +0800
thread-index: AcZRekWGxWEizCsoTq6Hs0RHgS1XIwThread-Topic: Wb2312?B?16Ky4bOsxNTBprvh1LGzybmmo6E-

62,025

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧