I'm in a situation where I have a standard System.Net.Mail.Smtpclient instance set up (thanks to some older code) on one hand, and a Rebex MailMessage instance (loaded from eml - the reason why I used Rebex) on the other.
Way I see it, the easiest way to send that message is to create a Rebex.Net.Smtp client instance and set it up using properties from the System.Net.Mail client. However, I cannot find a way to set the UseDefaultCredentials property... how can I do that?
I found a property of the same name in the Rebex documentation, but it seems to apply only to the static Send method via SmtpConfiguration class - I am however using an instance of the client.
System.Net.Mail.SmtpClient SystemClient = Mail.GetSmtpClient(Con, null);
Rebex.Mail.MailMessage msg = new Rebex.Mail.MailMessage();
msg.Load(FileName);
Rebex.Net.Smtp client = new Smtp();
if (SystemClient.EnableSsl){
client.Connect(SystemClient.Host, SystemClient.Port, null, SmtpSecurity.Explicit);
}
else{
client.Connect(SystemClient.Host, SystemClient.Port);
}
if (SystemClient.UseDefaultCredentials){
???
}