日期:2014-05-20  浏览次数:20978 次

发邮件
同样的代码,我如果把邮箱都换成是163的就能,换成126的就发不出去
大家看看我哪里错了
MailMessage       MailObj=new       MailMessage();      
MailObj.From= "llwhr2006@126.com ";    
MailObj.To= "llwhr2006@126.com ";      
MailObj.Subject= "帮您找回密码 ";    
 
MailObj.Body= " <html> <body> <P> "+ "aaaaaaaaaa "+ "您好: </P> <P>   您注册的会员密码是 "+ "bbbbbbbbbbb "+ ",感谢您的关注! </P> <P>                           <STRONG> **客服 </STRONG> </P> </body> </html> ";      
MailObj.BodyFormat=MailFormat.Html;//设置电子邮件正文的内容类型为   HTML格式  

MailObj.Fields.Add(@ "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate ",       "1 ");       //表示基本验证      
MailObj.Fields.Add(@ "http://schemas.microsoft.com/cdo/configuration/sendusername ",       "llwhr2006@126.com ");            
MailObj.Fields.Add(@ "http://schemas.microsoft.com/cdo/configuration/sendpassword ",       "*** ");            
SmtpMail.SmtpServer       =       "smtp.126.com ";           //邮件服务器地址      
try      
{      
SmtpMail.Send(MailObj);      
}      
catch      
{      
Response.Write( " <script> window.alert( ' "+ "发生故障,邮件没有发送成功,您可以选择其它方式和我们联系! "+ " ') </script> ");      
return;            
}      
Response.Write( " <script> window.alert( ' "+ "密码已经成功发送到您注册的邮箱,! "+ " ') </script> ");

------解决方案--------------------
126的邮件服务器是这个吗?