Take a look at the example below. It will definitely work for you, though you’ll need to update the part with credentials, smtp server and such. After that you are good to go:
private static void SendEmail(string to, string subject, string body, bool isHtml)
{
SmtpClient client = new SmtpClient(Config.SmptSettings.Server);
client.Credentials = new NetworkCredential("username", "password");
client.Port = 25; //or whatever is the port number for your email server
MailMessage msg = new MailMessage();
msg.To.Add(new MailAddress(to));
msg.Subject = subject;
msg.Body = body;
msg.IsBodyHtml = isHtml;
client.Send(msg);
}
For reading registry key check out this article:
http://www.codeproject.com/Tips/294991/Read-Registry-using-Csharp
No comments:
Post a Comment