smtp problem (system.net.mail)

I've written email pro in asp .net

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim mail As New MailMessage()

Try

'set the addresses

mail.From = New MailAddress("name@company.com")

mail.To.Add(youname@comapny.com)

'set the content

mail.Subject = "This is an email"

mail.Body = "this is the body content of the email."

'send the message

Dim smtp1 As New SmtpClient("mail.company.com", 25)

Dim basicAuthenticationInfo As New System.Net.NetworkCredential("name", "pass")

smtp1.Credentials = smtp1.Credentials

smtp1.UseDefaultCredentials = False

smtp1.Credentials = basicAuthenticationInfo

smtp1.Send(mail)

Catch ex As Exception

Response.Write(ex.Message)

End Try

End Sub

i got this error

Transaction failed. The server response was: The IP Address of the sender (202.46.122.38) was found in a DNS blacklist database and was therefore refused.

pls advise me



Answer this question

smtp problem (system.net.mail)

  • *Sledge

    It appears the SMTP server you are trying to send to is refusing to accept mail from your IP address. You would need to clear this up with the server admin.

  • smtp problem (system.net.mail)