using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Net.Mail; public partial class Default2 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void ImageButton1_Click1(object sender, ImageClickEventArgs e) { EcoMail.sendMail(txtName.Text, txtTitle.Text, txtCompany.Text, txtSector.SelectedValue, txtAddress.Text, txtCity.Text, Select1.SelectedItem.Text, txtEmail.Text, Select1.SelectedValue + txtPhone.Text, txtMobil.Text, txtComment.Text, CheckBox1.Checked); clearData(); } private void clearData() { txtComment.Text = string.Empty; txtCompany.Text = string.Empty; txtEmail.Text = string.Empty; txtMobil.Text = string.Empty; txtPhone.Text = string.Empty; txtTitle.Text = string.Empty; txtName.Text = string.Empty; txtCity.Text = string.Empty; CheckBox1.Checked = false; txtAddress.Text = string.Empty; txtFax.Text = string.Empty; txtSector.SelectedIndex = -1; Select1.SelectedIndex = -1; // Label1.Visible = true; Label1.Text = "Mail sent successfully"; } }