今天做了个找回密码的功能,发送邮箱时不能成功。在本地行,放到服务器就不行了,端口和防火墙都已经都没问题。System.Net.Mail.SmtpException: 发送邮件失败。 ---> System.Net.WebException: 无法连接到远程服务器 ---> System.Net.Sockets.SocketException: 由于目标机器积极拒绝,无法连接。 123.125.50.134:25 在 System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) 在 System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) 在 System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) --- 内部异常堆栈跟踪的结尾 --- 在 System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6, Int32 timeout) 在 System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 timeout, GeneralAsyncDelegate asyncCallback) 在 System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback) 在 System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) 在 System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) 在 System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) 在 System.Net.Mail.SmtpClient.GetConnection() 在 System.Net.Mail.SmtpClient.Send(MailMessage message) --- 内部异常堆栈跟踪的结尾 --- 在 System.Net.Mail.SmtpClient.Send(MailMessage message) 在 MailControl.SendMail(String FromSMTP, String FromEmail, String FromPassword, String ToEmail, String Subject, String Body) 位置 e:\easyuserver\es10100\web\index\App_Code\MailControl.cs:行号 165

解决方案 »

  1.   

    重启一下试试,同样的程序在本机正常在服务器不正常,肯定是服务器的运行环境与本机不同(系统设置)。
      

  2.   

    邮件发送服务器不对呀。连不上检查你的ip,端口,用户名,密码等信息看是否正确
      

  3.   

    重启也不好使,密码什么的都正确,防火墙一关,都不好使。
      

  4.   

    好像是端口的问题,有两台服务器另一台就好使,端口无法使用。
      

  5.   

    我现在也遇到了一个问题,不知道问题在哪里?
      

  6.   

    把防火墙关了~
    如果可以 再开防火墙 再开端口