Issues Sending Email through SMTP from Web Site

Discussion in 'ASP.NET / ASP.NET Core' started by mf0st3r, Feb 16, 2011.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Pulling Hair OUt!

    I have been attempting to setup an asp.net 2.0 website to send an email to newly registered users to validate their email before they can use the site.

    I have tried the following configurations:
    ALL with the same error message of "The remote certificate is invalid according to the validation procedure." Occurs when the Client.Send is called.

    Client.Host = "localhost"
    Blank Credentials

    Client.Host = "smtp.mydomain.net"
    Client.Port = 25
    Client.Credentials = mycredentials

    Client.Host = "smtp.mydomain.net"
    Client.Port = 587
    Client.Credentials = mycredentials

    I even tried this 'HACK' to bypass the certificate policy:
    Code:
    ServicePointManager.ServerCertificateValidationCallback = New RemoteCertificateValidationCallback(AddressOf ValidateCertificate)
    
    Private Function ValidateCertificate(ByVal sender As Object, ByVal certificate As X509Certificate, ByVal chain As X509Chain, ByVal sslPolicyErrors As SslPolicyErrors) As Boolean
            'Return True to force the certificate to be accepted.
            Return True
    End Function
    
    Sending emails over smtp is usually pretty straight forward. I'm not sure what the deal is here.
    Any help Would be greatly appreciated.
     
  2. This may seem like a stupid question, but I have to ask. Have you reviewed the following KB article??

    If haven't check it out and let us know if this KB does or does not help you resolve this matter.
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page