I have an win form app from which I want to be able to send bug
reports. My first approach was something like:
SmtpClient client = new SmtpClient( ????? );
MailAddress from = new MailAddress("fr**@from.com");
MailAddress to = new MailAddress("to@to.com");
MailMessage message = new MailMessage(from, to);
message.Body = "Email Body";
message.BodyEncoding = System.Text.Encoding.UTF8;
message.Subject = "Subject";
message.SubjectEncoding = System.Text.Encoding.UTF8;
client.Send(message);
message.Dispose();
I am having a couple of problems with this:
1) I don't want the user to have to specify the SMTP host. Is there a
way to figure that out programmatically and then set the appropriate
value?
2) On some machine I might need credentials. Is there a way around that
without having to prompt the user for this information?
Of course I am also open to other suggestion on other ways for the
customer to send bug reports without having to add any information
besides maybe some comment.
Thanks