Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Error

Error

Scheduled Pinned Locked Moved ASP.NET
helpcsharpcomgraphicsdesign
5 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 11127370
    wrote on last edited by
    #1

    Hi, I am getting the following error??? Please help??? ERROR: Server Error in '/Online_Book_Shopping' Application. ________________________________________ The remote name could not be resolved: 'smtp.gmail.com' Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Net.WebException: The remote name could not be resolved: 'smtp.gmail.com' Source Error: Line 60: smt.Port = 587; Line 61: smt.EnableSsl= true; Line 62: smt.Send(msg);//Error comes in this line of code Line 63: lblmsg.Text = "Username and Password Sent Successfully"; Line 64: lblmsg.ForeColor = System.Drawing.Color.ForestGreen; Source File: e:\Vijaya\Online_Book_Shopping\ForgetPassword.aspx.cs Line: 62 ============================================================================================= Following is the code:- using System.Net; using System.Net.Mail; using System.Drawing; using System.Configuration; using System.Data.SqlClient; using System.Data; public partial class ForgetPassword : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { string username = ""; string password = ""; string constr = ConfigurationManager.ConnectionStrings["CS"].ConnectionString; SqlConnection con = new SqlConnection(constr); { SqlCommand cmd = new SqlCommand("select Name, Password from dbo.RegisteredUsers where Email=@email", con); cmd.Parameters.AddWithValue("Email", txtemail.Text); con.Open(); using (SqlDataReader dr = cmd.ExecuteReader()) { if (dr.Read()) { username = dr["Name"].ToString(); password = dr["Password"].ToString(); } } con.Close(); if (!string.IsNullOrEmpty(username)) { MailMessage msg = new MailMessage(); msg.From = new MailAddress("nilusilu3@gmail.com"); msg.To.Add(txtemail.Text); msg.Subject = " Recover your Password"; msg.Body = ("Your Username is:" + username + "

    " + "Your Pas

    Kornfeld Eliyahu PeterK L F Richard DeemingR 4 Replies Last reply
    0
    • U User 11127370

      Hi, I am getting the following error??? Please help??? ERROR: Server Error in '/Online_Book_Shopping' Application. ________________________________________ The remote name could not be resolved: 'smtp.gmail.com' Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Net.WebException: The remote name could not be resolved: 'smtp.gmail.com' Source Error: Line 60: smt.Port = 587; Line 61: smt.EnableSsl= true; Line 62: smt.Send(msg);//Error comes in this line of code Line 63: lblmsg.Text = "Username and Password Sent Successfully"; Line 64: lblmsg.ForeColor = System.Drawing.Color.ForestGreen; Source File: e:\Vijaya\Online_Book_Shopping\ForgetPassword.aspx.cs Line: 62 ============================================================================================= Following is the code:- using System.Net; using System.Net.Mail; using System.Drawing; using System.Configuration; using System.Data.SqlClient; using System.Data; public partial class ForgetPassword : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { string username = ""; string password = ""; string constr = ConfigurationManager.ConnectionStrings["CS"].ConnectionString; SqlConnection con = new SqlConnection(constr); { SqlCommand cmd = new SqlCommand("select Name, Password from dbo.RegisteredUsers where Email=@email", con); cmd.Parameters.AddWithValue("Email", txtemail.Text); con.Open(); using (SqlDataReader dr = cmd.ExecuteReader()) { if (dr.Read()) { username = dr["Name"].ToString(); password = dr["Password"].ToString(); } } con.Close(); if (!string.IsNullOrEmpty(username)) { MailMessage msg = new MailMessage(); msg.From = new MailAddress("nilusilu3@gmail.com"); msg.To.Add(txtemail.Text); msg.Subject = " Recover your Password"; msg.Body = ("Your Username is:" + username + "

      " + "Your Pas

      Kornfeld Eliyahu PeterK Offline
      Kornfeld Eliyahu PeterK Offline
      Kornfeld Eliyahu Peter
      wrote on last edited by
      #2

      First check if there is internet connection at all... Than try some changes in your code:

      smt.UseDefaultCredentials = false;
      smt.Credentials = new NetworkCredential("username", "password");
      smt.DeliveryMethod = SmtpDeliveryMethod.Network;

      Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.

      "It never ceases to amaze me that a spacecraft launched in 1977 can be fixed remotely from Earth." ― Brian Cox

      1 Reply Last reply
      0
      • U User 11127370

        Hi, I am getting the following error??? Please help??? ERROR: Server Error in '/Online_Book_Shopping' Application. ________________________________________ The remote name could not be resolved: 'smtp.gmail.com' Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Net.WebException: The remote name could not be resolved: 'smtp.gmail.com' Source Error: Line 60: smt.Port = 587; Line 61: smt.EnableSsl= true; Line 62: smt.Send(msg);//Error comes in this line of code Line 63: lblmsg.Text = "Username and Password Sent Successfully"; Line 64: lblmsg.ForeColor = System.Drawing.Color.ForestGreen; Source File: e:\Vijaya\Online_Book_Shopping\ForgetPassword.aspx.cs Line: 62 ============================================================================================= Following is the code:- using System.Net; using System.Net.Mail; using System.Drawing; using System.Configuration; using System.Data.SqlClient; using System.Data; public partial class ForgetPassword : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { string username = ""; string password = ""; string constr = ConfigurationManager.ConnectionStrings["CS"].ConnectionString; SqlConnection con = new SqlConnection(constr); { SqlCommand cmd = new SqlCommand("select Name, Password from dbo.RegisteredUsers where Email=@email", con); cmd.Parameters.AddWithValue("Email", txtemail.Text); con.Open(); using (SqlDataReader dr = cmd.ExecuteReader()) { if (dr.Read()) { username = dr["Name"].ToString(); password = dr["Password"].ToString(); } } con.Close(); if (!string.IsNullOrEmpty(username)) { MailMessage msg = new MailMessage(); msg.From = new MailAddress("nilusilu3@gmail.com"); msg.To.Add(txtemail.Text); msg.Subject = " Recover your Password"; msg.Body = ("Your Username is:" + username + "

        " + "Your Pas

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        It is no wonder so much hacking continues when people still store passwords in clear text. Please read Secure Password Authentication Explained Simply[^] and use some proper security on your site. You should also not send passwords via email, there are better, more secure methods, of resetting a user password.

        1 Reply Last reply
        0
        • U User 11127370

          Hi, I am getting the following error??? Please help??? ERROR: Server Error in '/Online_Book_Shopping' Application. ________________________________________ The remote name could not be resolved: 'smtp.gmail.com' Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Net.WebException: The remote name could not be resolved: 'smtp.gmail.com' Source Error: Line 60: smt.Port = 587; Line 61: smt.EnableSsl= true; Line 62: smt.Send(msg);//Error comes in this line of code Line 63: lblmsg.Text = "Username and Password Sent Successfully"; Line 64: lblmsg.ForeColor = System.Drawing.Color.ForestGreen; Source File: e:\Vijaya\Online_Book_Shopping\ForgetPassword.aspx.cs Line: 62 ============================================================================================= Following is the code:- using System.Net; using System.Net.Mail; using System.Drawing; using System.Configuration; using System.Data.SqlClient; using System.Data; public partial class ForgetPassword : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { string username = ""; string password = ""; string constr = ConfigurationManager.ConnectionStrings["CS"].ConnectionString; SqlConnection con = new SqlConnection(constr); { SqlCommand cmd = new SqlCommand("select Name, Password from dbo.RegisteredUsers where Email=@email", con); cmd.Parameters.AddWithValue("Email", txtemail.Text); con.Open(); using (SqlDataReader dr = cmd.ExecuteReader()) { if (dr.Read()) { username = dr["Name"].ToString(); password = dr["Password"].ToString(); } } con.Close(); if (!string.IsNullOrEmpty(username)) { MailMessage msg = new MailMessage(); msg.From = new MailAddress("nilusilu3@gmail.com"); msg.To.Add(txtemail.Text); msg.Subject = " Recover your Password"; msg.Body = ("Your Username is:" + username + "

          " + "Your Pas

          F Offline
          F Offline
          F ES Sitecore
          wrote on last edited by
          #4

          Don't send email via gmail, don't send passwords via email, don't store passwords in clear text. Literally everything you are doing are things you shouldn't do. As for the error it is a network error, nothing to do with your code and nothing that can be solved with code. Google the error for more info.

          1 Reply Last reply
          0
          • U User 11127370

            Hi, I am getting the following error??? Please help??? ERROR: Server Error in '/Online_Book_Shopping' Application. ________________________________________ The remote name could not be resolved: 'smtp.gmail.com' Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Net.WebException: The remote name could not be resolved: 'smtp.gmail.com' Source Error: Line 60: smt.Port = 587; Line 61: smt.EnableSsl= true; Line 62: smt.Send(msg);//Error comes in this line of code Line 63: lblmsg.Text = "Username and Password Sent Successfully"; Line 64: lblmsg.ForeColor = System.Drawing.Color.ForestGreen; Source File: e:\Vijaya\Online_Book_Shopping\ForgetPassword.aspx.cs Line: 62 ============================================================================================= Following is the code:- using System.Net; using System.Net.Mail; using System.Drawing; using System.Configuration; using System.Data.SqlClient; using System.Data; public partial class ForgetPassword : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { string username = ""; string password = ""; string constr = ConfigurationManager.ConnectionStrings["CS"].ConnectionString; SqlConnection con = new SqlConnection(constr); { SqlCommand cmd = new SqlCommand("select Name, Password from dbo.RegisteredUsers where Email=@email", con); cmd.Parameters.AddWithValue("Email", txtemail.Text); con.Open(); using (SqlDataReader dr = cmd.ExecuteReader()) { if (dr.Read()) { username = dr["Name"].ToString(); password = dr["Password"].ToString(); } } con.Close(); if (!string.IsNullOrEmpty(username)) { MailMessage msg = new MailMessage(); msg.From = new MailAddress("nilusilu3@gmail.com"); msg.To.Add(txtemail.Text); msg.Subject = " Recover your Password"; msg.Body = ("Your Username is:" + username + "

            " + "Your Pas

            Richard DeemingR Offline
            Richard DeemingR Offline
            Richard Deeming
            wrote on last edited by
            #5

            Troy Hunt: Everything you ever wanted to know about building a secure password reset feature[^]


            "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

            "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups