//mail sending MailMessage mail = new MailMessage(); mail.From = new MailAddress("abc@gmail.com"); mail.To.Add("abc@gmail.com"); //to send mail on textbox value use this code. mail.To.Add("abc@gmail.com"); mail.IsBodyHtml = true; mail.Subject = "ABC"; mail.Body = "this is mail body"; SmtpClient smtp = new SmtpClient("smtp.gmail.com", 587); smtp.Credentials = new System.Net.NetworkCredential("abc@gmail.com", "9876543210"); smtp.EnableSsl = true; smtp.Send(mail); TxtFullName.Text = ""; TxtEmailID.Text = ""; TxtContactNo.Text = ""; TxtFeedback.Text = ""; LblMsg.Text = "Your Mail is Submited...";
i am used above code for Email sending, it is work well project are run as Local host.... but when project are run on Server, then mail are not send... it is display the error... Error Is :- Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
<configuration> <system.web> <customErrors mode="Off"/> </system.web> </configuration>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)