Mark Fenech

Mark Fenech

  • NA
  • 82
  • 69k

Sending Email in C#

Apr 20 2011 12:11 PM
I am trying to send email in C# using this code but smtp Exception Failure to send

this is my code

 message.From = new MailAddress("[email protected]", "Mark Fenech");
                message.To.Add(txt_emailTo.Text);
                message.Subject = txt_Subject.Text;
                message.Body = txt_emailBody.Text;

                SmtpClient smtp = new SmtpClient();

                smtp.Host = "LOCALHOST";
                smtp.EnableSsl = false;

                smtp.Send(message);

Answers (12)