I' am developing simple windows form application using C#. in this case I need to send email using this application. And in this time I already configured Mozilla Thunderbird as default mail client. My code requires default mail client smtp host and credentials. therefore I need to get these things from windows default mail client.
My Code:
MailMessage mail = new MailMessage();
//set the addresses
mail.From = new MailAddress("example@gmail.com");
mail.To.Add("example1@gmail.com");
//set the content
mail.Subject = "sampleSubject";
mail.Body = "sampleBody";
//add an attachment from the filesystem
mail.Attachments.Add(new Attachment(filePath));
//send the message
SmtpClient smtp = new SmtpClient("smtpHOst");
smtp.Credentials = new NetworkCredential("username", "password");
smtp.Send(mail);