Problem sending mail with simple .net application. Server refusal error.

Posted by Fatih on Stack Overflow See other posts from Stack Overflow or by Fatih
Published on 2010-04-15T19:25:12Z Indexed on 2010/04/15 19:43 UTC
Read the original article Hit count: 493

Filed under:
|
|

I have a very simple .net application for testing SMTP on .net. But i am receiving this weird error. "System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it"

SMTP server is remote and doesn't need any kind of authentication so i don't need credentials. But i can send mails from this computer with outlook using same smtp server and same smtp settings without any problem.

Any ideas? It will be appreciated so much.

Imports System.Net.Mail 

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim smtp As New SmtpClient
    smtp.Host = "10.241.128.220"
    smtp.Port = 25
    smtp.Send("[email protected]", "[email protected]", "test", "test")
End Sub

© Stack Overflow or respective owner

Related posts about vb.net

Related posts about smtp