Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. The remote certificate is invalid according to the validation procedure.

The remote certificate is invalid according to the validation procedure.

Scheduled Pinned Locked Moved C#
helpcsharpcomsysadmincryptography
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    khosnur
    wrote on last edited by
    #1

    Dearest Developers, i can send programmatically(C#) insecure smtp mail. but when i try to send secure mail. the above error thrown.but if i use gmail(smtp.gmail.com) i can send mail.but when i use our secure smtp mail server(mail.nibssolutions.net)it does not send. how i fix it. plz help me. thanks in advance Code: MailAddress SendFrom = new MailAddress("test@nibssolutions.net"); MailAddress SendTo = new MailAddress("rudro_aiub@yahoo.com"); MailMessage myMessage = new MailMessage(SendFrom, SendTo); myMessage.Subject = "Subject"; myMessage.Body = "Body"; //SmtpClient _smtpClient = new SmtpClient("mail.nibssolutions.net",25); SmtpClient _smtpClient = new SmtpClient("mail.nibssolutions.net", 587); _smtpClient.EnableSsl = true; _smtpClient.Credentials = new System.Net.NetworkCredential("test@nibssolutions.net", "*********"); _smtpClient.Send(myMessage); MessageBox.Show("Mail Sent...");

    C 1 Reply Last reply
    0
    • K khosnur

      Dearest Developers, i can send programmatically(C#) insecure smtp mail. but when i try to send secure mail. the above error thrown.but if i use gmail(smtp.gmail.com) i can send mail.but when i use our secure smtp mail server(mail.nibssolutions.net)it does not send. how i fix it. plz help me. thanks in advance Code: MailAddress SendFrom = new MailAddress("test@nibssolutions.net"); MailAddress SendTo = new MailAddress("rudro_aiub@yahoo.com"); MailMessage myMessage = new MailMessage(SendFrom, SendTo); myMessage.Subject = "Subject"; myMessage.Body = "Body"; //SmtpClient _smtpClient = new SmtpClient("mail.nibssolutions.net",25); SmtpClient _smtpClient = new SmtpClient("mail.nibssolutions.net", 587); _smtpClient.EnableSsl = true; _smtpClient.Credentials = new System.Net.NetworkCredential("test@nibssolutions.net", "*********"); _smtpClient.Send(myMessage); MessageBox.Show("Mail Sent...");

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      You need to work out what your mail server needs to send secure mail, and provide it.

      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

      K 1 Reply Last reply
      0
      • C Christian Graus

        You need to work out what your mail server needs to send secure mail, and provide it.

        Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

        K Offline
        K Offline
        khosnur
        wrote on last edited by
        #3

        Graus, Thanks for ur reply.But mails are sending from ms outlook 2007. but i can not send mail programmatically. Any idea to ignore certificate problem for sending mail.is it need to add any code in my program? Thanks in advance Shafik

        C 1 Reply Last reply
        0
        • K khosnur

          Graus, Thanks for ur reply.But mails are sending from ms outlook 2007. but i can not send mail programmatically. Any idea to ignore certificate problem for sending mail.is it need to add any code in my program? Thanks in advance Shafik

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          The only mail setting I know that you're not setting is 'UseDefaultCredentials'. Is the username/password your code provides, the same one that Outlook is using ?

          Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

          K 1 Reply Last reply
          0
          • C Christian Graus

            The only mail setting I know that you're not setting is 'UseDefaultCredentials'. Is the username/password your code provides, the same one that Outlook is using ?

            Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

            K Offline
            K Offline
            khosnur
            wrote on last edited by
            #5

            Dear Graus, Than u very much i just block the line //_smtpClient.EnableSsl = true; now it works fine.or if i use _smtpClient.UseDefaultCredentials = false; it also works fine. thanks u a lot. Shafik

            C 1 Reply Last reply
            0
            • K khosnur

              Dear Graus, Than u very much i just block the line //_smtpClient.EnableSsl = true; now it works fine.or if i use _smtpClient.UseDefaultCredentials = false; it also works fine. thanks u a lot. Shafik

              C Offline
              C Offline
              Christian Graus
              wrote on last edited by
              #6

              np. I suspect you want to use the useDefaultCredentials to false, for it to send as ssl.

              Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups