string from = "noreply@mail.org"; string to = "mail1@name.org"; string Password = "password$"; int port = Convert.ToInt32(ConfigurationManager.AppSettings["port"]); string smtp = Convert.ToString(ConfigurationManager.AppSettings["smtp"]); string Subject = "Enquiry"; string body = "Sender Name :" + txtname.Text + "\n" + "Phone :" + txtphone.Text + "\n" + "Email :" + txtemail.Text + "\n" + "Address :" + txtaddress.Text + "\n" + "Enquiry :" + txtenquiry.Text; MailMessage Msg = new MailMessage(from, to, Subject, body); //Smtp Host is the name or Ip host of the computer used for sending mail SmtpClient smtpobj = new SmtpClient("smtp.rediffmailpro.com", 25); smtpobj.Host = "smtp.rediffmailpro.com"; smtpobj.Port = 25; smtpobj.EnableSsl =false; smtpobj.UseDefaultCredentials = true; smtpobj.Credentials = new System.Net.NetworkCredential(from, Password); try { smtpobj.Send(Msg); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "Hi", "<script type='text/javascript'>alert('Your Message Has Been Send ');</script>", false); CleaContents(); } catch (Exception ex) { lbltext.Text = ex.Message; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)