2014-03-27 4 views
0

VPS windows 2012에서 메일을 보내려고했습니다. & 원격 메일 서버를 사용하는 IIS 8 서버에서 메일을 보낼 수 없으며 오류가 발생했습니다.'System.Net.Mail.SmtpException : 원격 메일 서버에서 메일을 보내지 못했습니다.

send Faild - System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: Unable to connect to the remote server ---> 
System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, 
or established connection failed because connected host has failed to respond <Ip Address> at System.Net.Sockets.Socket.DoConnect(EndPoint 
endPointSnapshot, SocketAddress socketAddress) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, 
Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception) --- End of inner exception stack 
trace --- at System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, 
Socket& abortSocket6) at System.Net.PooledStream.Activate(Object owningObject, Boolean async, GeneralAsyncDelegate asyncCallback) at  System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) at  System.Net.Mail.SmtpConnection.GetConnection(ServicePoint servicePoint) at System.Net.Mail.SmtpClient.Send(MailMessage message) --- End of 
inner exception stack trace --- at System.Net.Mail.SmtpClient.Send(MailMessage message) at WebApplication1.Default.Page_Load(Object sender, EventArgs e) 

코드는 VPS에서 텔넷 SMTP 서버에

<% 

Dim Email As New System.Net.Mail.MailMessage(_"[email protected]", "[email protected]") 
Email.Subject = "test subject" 
Email.Body = "this is a test" 
Dim mailClient As New System.Net.Mail.SmtpClient() 
'This object stores the authentication values 
Dim basicAuthenticationInfo As _ 
New System.Net.NetworkCredential("username", "password") 
mailClient.Host = "host" 
mailClient.UseDefaultCredentials = False 
mailClient.Credentials = basicAuthenticationInfo 
mailClient.Send(Email) 

%> 

갱신

하지 수를 사용하지만, 지역 시스템에서의 수.

+0

가 많은 이유가 될 수 마지막으로 실제 SMTP 서버에 연결하는 응용 프로그램을 중지하는 방법으로 점점 더 스팸 방지가 없습니다 확인 이. SMTP 요청을 차단할 수있는 방화벽이 뒤에 있습니까? 주소가 맞습니까? –

+1

SMTP 서버에 연결할 수 없다고 생각합니다. 방화벽 또는 바이러스 백신 소프트웨어 일 수 있습니다. 방화벽 및 바이러스 백신 소프트웨어에서 허용해야합니다. –

+0

방화벽이 꺼져 있어도 작동하지 않는 경우 로컬 서버에서 제대로 작동합니다. – sarath009

답변

1
  • 방화벽에 IIS 서버의 보내는 IP 주소를 추가해야 할 수도 있습니다. 가능한 경우 http://whatismyipaddress.com/으로 가면 발신 주소가 표시됩니다.
  • 당신은 당신의 안티 바이러스 구성을 볼 필요가 있습니다 - 당신이 McAffee를 사용하는 경우이 도움이 될 수 http://digital.ni.com/public.nsf/allkb/76D1CFA7F3C047D08625719B006861B5
  • 을 대신 SMTP 서버 호스트 이름으로 코드에서 "호스트"를 지정하는 당신의 IP 주소를 지정 시도 할 수 또한 SMTP 서버
  • 당신은 SMTP 서버로 텔넷 수있게되면,
관련 문제