Send Email Localhost - C#

Send Email Localhost - C#

code snippet

c#
using (var client = new SmtpClient{
Host = "127.0.0.1",
Port = 25
}){
var mail = new MailMessage();
mail.From = new System.Net.Mail.MailAddress("from@email.com");
mail.To.Add("to@email.com"); 
mail.Subject = "Email Subject";
mail.Body = "Email Body";
mail.IsBodyHtml = false; // or true
try{
    client.Send(mail);
}
catch (Exception){
}

"What we think, we become"

Contact me!

Have questions? Feel free to use the form or send me an email with any questions.

I will be responsive to your requests and your questions.