title: Send Email After Button Click in ASP.net C#
body: <p>Hi i am trying to send am email after Button click in Asp.net.</p>
  
  <p>The emails to send the email to will be retrieved from a query.</p>
  
  <pre><code>        string connectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
          SqlDataReader reader;
          string sendMessage = "SELECT aspnet_Membership.Email FROM aspnet_Membership join User_Profile on User_Profile.UserId = aspnet_Membership.UserId JOIN Project_List on Project_List.ProfileId = User_Profile.ProfileId WHERE Project_List.ProfileId = 1";
  
          using (SqlConnection myConnection = new SqlConnection(connectionString))
          {
              myConnection.Open();
              SqlCommand myCommand = new SqlCommand(sendMessage, myConnection);
  
  
  
              ArrayList emailArray = new ArrayList();
              reader = myCommand.ExecuteReader();
  
  
              while (reader.Read())
              {
                  emailArray.Add(reader["email"]);
              }
  
              foreach (string email in emailArray)
  </code></pre>
  
  <p>it doesn't come up with any errors, and i don't receive any emails</p>