Hi,
I have an issue with our SmtpClient. Our Smtp-Server requires authentication and I tried it with SecurityMode automatic but via WireShark I saw that not AUTH comamnd is send.
So I tried to set it so NTLM but it seems to have no effect. Perhaps I misunderstood something.
Here is the code I am using. I used a alias for Aspose to prevent a conflict with the .NET SmtpClient
var client = new AsposeSmtpClient(Host) {
EnableSsl = EnableSsl,
Password = Password,
Port = Port,
Username = Username,
};
ServicePointManager.ServerCertificateValidationCallback += RemoteCertificateValidationHandler;
client.SecurityMode = SmtpSslSecurityMode.Explicit;
client.AuthenticationMethod = SmtpAuthentication.Ntlm;
var message = new AsposeMailMessage() {
From = new MailAddress(mailMessage.From)
};
message.To.Add(mailMessage.To);
message.Subject = mailMessage.Subject;
message.TextBody = mailMessage.TextBody;
try {
client.Send(message);
} catch (AsposeSmtpException e) {
throw new SmtpException("Error", e);
}
}Before I forget, could you tell me what is the difference between the 2 SmtpSslSecurityMode value? When to use what?
And another point is, our SSL Ceritificate is invalid. Is ther e some way to ignore this? I tried it with the event ServerCertificateValidationCallback (found it in the forum related to imap) but it doesn't work.
Regards,
Torsten