public void sentMail(string from,string to,string subject,string body)
{
MailMessage mailObj = new MailMessage(from,to,subject, body);
SmtpClient SMTPServer = new SmtpClient(“localhost”);
try
{
SMTPServer.Send(mailObj);
Label1.Text = “Mail Sent”;
}
catch (Exception ex)
{
Label1.Text = ex.ToString();
}
}
Tagged: ASP.NET, Mail, Send Mail using Local SMTP, SendMail using C#, SMTP
Leave a Reply