The remote certificate is invalid according to the validation procedure.
-
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...");
-
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...");
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.
-
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.
-
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
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.
-
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.
-
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
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.