The following code is to send a mail by C# code.
Assembly assembly = typeof(System.Net.Mail.SmtpClient).Assembly;
Type tMailWriter = assembly.GetType("System.Net.Mail.MailWriter");
object mailWriter = Activator.CreateInstance(tMailWriter, flags, null, new object[] { ms }, CultureInfo.InvariantCulture);
msg.GetType().GetMethod("Send", flags).Invoke(msg, new object[] { mailWriter, true });
Regarding the System.Net.Mail.MailWriter, I cannot find this class by browsing the dll. Please see the screen shot. What is the problem? Where can I find it? Thank you.
Update:
In this question, I mainly focus on why we cannot browse some class in dll throw VS. Now I find the answer. It is not a public class.