日期:2014-05-17  浏览次数:20485 次

ASP.NET 发送邮件问题
C# code

                MailMessage m = new MailMessage();
                m.From = new MailAddress(localMail, localName);
                m.To.Add(TO);
                m.Subject = SUBJECT;
                m.Body = BODY;
                m.BodyEncoding = System.Text.Encoding.UTF8;
                m.IsBodyHtml = bIsHtml;
                m.ReplyTo = new MailAddress(localMail);
                m.Priority = MailPriority.High;
                SmtpClient smtp = new SmtpClient("smtp.163.com");
                smtp.Credentials = new NetworkCredential("account", "password");
                smtp.EnableSsl = true;
                smtp.Send(m);



在本地中发送是没有问题,部署到Windows Server 2003 II后 就无法发送了,什么原因?

------解决方案--------------------
smtp.163.com这个应该不可用
用qq的试:smtp.qq.com
------解决方案--------------------
wind2003上是不是没把端口打开?
------解决方案--------------------
没回复内容?
------解决方案--------------------
嗯,发送邮件需要打开一个服务端口才行.楼上说的对.