protected void btnSubmit_Click(object sender, EventArgs e) { try { MailMessage Msg = new MailMessage(); // Sender e-mail address. Msg.From = new MailAddress(txtEmail.Text); // Recipient e-mail address. Msg.To.Add("xxxxx"); Msg.Subject = txtSubject.Text; string details = txtmobile.Text + '\n'; Msg.Body = details + txtMessage.Text; // your remote SMTP server IP. SmtpClient smtp = new SmtpClient(); smtp.Host = "smtpout.secureserver.net"; smtp.Port = 80; smtp.Credentials = new System.Net.NetworkCredential("xxxx", "xxxx"); smtp.EnableSsl = false; smtp.Send(Msg); //Msg = null; lbltxt.Text = "Thank you for contacting us."; // Clear the textbox valuess txtName.Text = ""; txtSubject.Text = ""; txtmobile.Text = ""; txtMessage.Text = ""; txtEmail.Text = ""; } catch (Exception ex) { Console.WriteLine("{0} Exception caught.", ex); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)