المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : The remote certificate is invalid according to the validation procedure.



C# Programming
09-14-2009, 07:07 PM
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...");