Failure Sending Mail Error In Asp.net
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Failure sending mail using asp.net up vote 0 down vote favorite Below is my code for sending confirmation link to mail and I am getting errors like Failure sending mail. After sending confirmation link to email then user will reset the password. string uniqueCode = string.Empty; SqlCommand cmd = new SqlCommand(); SqlDataReader dr; try { SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["conn"].ConnectionString); if (con.State == ConnectionState.Closed) { con.Open(); } // get the records matching the supplied username or email id. cmd = new SqlCommand("select * from Tbl_Login where UserName COLLATE Latin1_general_CS_AS=@username or EmailId COLLATE Latin1_general_CS_AS=@emailId", con); cmd.Parameters.AddWithValue("@username", Convert.ToString(txtUserName.Text.Trim())); cmd.Parameters.AddWithValue("@emailId", Convert.ToString(txtEmailId.Text.Trim())); dr = cmd.ExecuteReader(); cmd.Dispose(); if (dr.HasRows) { dr.Read(); //generate unique code uniqueCode = Convert.ToString(System.Guid.NewGuid()); //Updating an unique random code in then UniquCode field of the database table cmd = new SqlCommand("update Tbl_Login set Uniquecode=@uniqueCode where UserName=@username or EmailId=@emailid", con); cmd.Parameters.AddWithValue("@uniqueCode", uniqueCode); cmd.Parameters.AddWithValue("@username", txtUserName.Text.Trim()); cmd.Parameters.AddWithValue("@emailid", txtEmailId.Text.Trim()); StringBuilder strBody = new StringBuilder(); //Passing emailid,
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million http://stackoverflow.com/questions/29981966/failure-sending-mail-using-asp-net programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error:Failure sending mail in asp.net up vote 4 down vote favorite 2 i have a problem for sending email i enter valid email but when a i click submit button i get this error, Error: Failure sending mail here http://stackoverflow.com/questions/13900929/errorfailure-sending-mail-in-asp-net is my code(web.Config)
360 games PC games https://support.microsoft.com/en-us/kb/2183292 Windows games Windows phone games Entertainment All Entertainment Movies & TV Music Business & Education Business Students & educators https://www.daniweb.com/programming/web-development/threads/308118/error-in-sending-e-mail-in-asp-net Developers Sale Sale Find a store Gift cards Products Software & services Windows Office Free downloads & security Internet failure sending Explorer Microsoft Edge Skype OneNote OneDrive Microsoft Health MSN Bing Microsoft Groove Microsoft Movies & TV Devices & Xbox All Microsoft devices Microsoft Surface All Windows PCs & tablets PC accessories Xbox & games Microsoft Lumia All failure sending mail Windows phones Microsoft HoloLens For business Cloud Platform Microsoft Azure Microsoft Dynamics Windows for business Office for business Skype for business Surface for business Enterprise solutions Small business solutions Find a solutions provider Volume Licensing For developers & IT pros Develop Windows apps Microsoft Azure MSDN TechNet Visual Studio For students & educators Office for students OneNote in classroom Shop PCs & tablets perfect for students Microsoft in Education Support Sign in Cart Cart Javascript is disabled Please enable javascript and refresh the page Cookies are disabled Please enable cookies and refresh the page CV: {{ getCv() }} English (United States) Terms of use Privacy & cookies Trademarks © 2016 Microsoft
asp on local host which worked fine but The prob has occurred when i hosted the pages the error message is: Failure sending mail. and the code i am using: Dim message As New MailMessage message.From = New MailAddress("xxx@gmail.com") message.To.Add(New MailAddress("xxx@yahoo.com")) message.Subject = test mail"" message.Body = "Hi you have got a test mail from me! Dim client As New SmtpClient client.Credentials = New System.Net.NetworkCredential("xxx@gmail.com", "xxxxxxx") client.Port = 587 client.Host = "smtp.gmail.com" client.EnableSsl = True client.Send(message) Please help me! .net asp.net vb Sunil K http://www.tarwara.info tarwara 15 posts since Jul 2010 Community Member 5Contributors 4Replies 5Views 6 YearsDiscussion Span 5 Years Ago Last Post by jugosoft 0 plusplus 6 Years Ago to get exact error, put it in a try, catch (errmsg is a label on the form) Try Client.Send(message) Catch smtpEx As SmtpException 'A problem occurred when sending the email message errmsg.text = "Problem sending message: " & smtpEx.Message.Replace("'", "\'") Catch generalEx As Exception 'Some other problem occurred errmsg.text = "Sending Mail Failed. General Exception! " & generalEx.Message.Replace("'", "\'") End Try 0 samkaraja 6 Years Ago do you finish your iis configuration at your system. 0 umamahesh2020 -5 5 Years Ago Try This Code using System; using System.Data; using System.Configuration; using System.Collections.Generic; using System.Linq; 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; using System.Windows.Forms; public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void btnSend_Click(object sender, EventArgs e) { try { MailMessage mm = new MailM