public partial class pgEmail : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void btnSend_Click(object sender, EventArgs e) { try { //create object clsBusinessLayer class and call sendMail method clsBusinessLayer sendObj = new clsBusinessLayer(); sendObj.SendEmail(txtFrom.Text, txtTo.Text, txtSubject.Text, txtMessage.Text); //set the successful mail sent message to the status label lblStatus.Text = "The message was sent to: " + txtTo.Text; } catch (Exception ex) { // set the not successful mail sent message to the status label lblStatus.Text = "An error has occurred while trying to send this message, " + ex.Message; } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)