Send mail using local SMPT server

 public void sentMail(string from,string to,string subject,string body)
MailMessage mailObj = new MailMessage(from,to,subject, body);
SmtpClient SMTPServer = new SmtpClient(“localhost”);
Label1.Text = “Mail Sent”;
catch (Exception ex)
Label1.Text = ex.ToString();

Tagged: , , , ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: