谢谢
------解决方案--------------------------------------------------------
没用过,帮顶。我是用CDO组件来发邮件
------解决方案--------------------------------------------------------
也没用过,帮顶
------解决方案--------------------------------------------------------
^_^都是来帮顶的...
------解决方案--------------------------------------------------------
给你一个网址,看看吧
http://tag.csdn.net/tag/lumisoft.xml
------解决方案--------------------------------------------------------
用.net自带的不行么?
FrameWork 1.1
============================================
#region 发送邮件
/// <summary>
/// 发送邮件
/// </summary>
/// <param name= "_UserName "> 用户名 </param>
/// <param name= "_Mail "> 用户注册的电子邮件 </param>
/// <param name= "_Pwd "> 用户登录密码 </param>
/// <returns> 是否发送成功 </returns>
public bool SendMail (string _UserName,string _Mail,string _Pwd)
{
string _adminMail = System.Configuration.ConfigurationSettings.AppSettings[ "AdminMail "].ToString();
string _adminMailPwd = System.Configuration.ConfigurationSettings.AppSettings[ "AdminMailPwd "].ToString();
string _adminMailSmtp = System.Configuration.ConfigurationSettings.AppSettings[ "AdminMailSMTP "].ToString();
MailMessage mailObj = new MailMessage();
mailObj.To = _Mail;
mailObj.From = _adminMail;
mailObj.Subject = "您的内网密码 ";
mailObj.Body = "尊敬的用户: <br/> 您好,您的内网注册信息如下 <br/> 用户名: " + _UserName + " 密码: " + _Pwd;
mailObj.BodyFormat = MailFormat.Html;
mailObj.Priority = MailPriority.High;
SmtpMail.SmtpServer = _adminMailSmtp;
string[] adminName = _adminMail.Split( '@ ');
///////////////////////////////////FrameWork1.1
mailObj.Fields.Add( "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate ", "1 ");
////设置验证用户名
mailObj.Fields.Add( "http://schemas.microsoft.com/cdo/configuration/sendusername ", adminName[0].ToString());
////设置验证密码
mailObj.Fields.Add( "http://schemas.microsoft.com/cdo/configuration/sendpassword ", _adminMailPwd);
//////////////////////////////////////////////
SmtpMail.Send(mailObj);
return true;
}
#endregion