Note that there are some explanatory texts on larger screens.

plurals
  1. POAn invalid character was found in the mail header: ';'
    primarykey
    data
    text
    <p>error on this line "message.To.Add(strCommandText);" when I try to take the email data from the database to send an email.</p> <hr> <p>public partial class beforeLogin_Auto_StaffPage : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) {</p> <pre><code>} protected void btnApprove_Click(object sender, EventArgs e) { string approve = "Approve"; string strConnectionString = ConfigurationManager.ConnectionStrings["ChadBankConnectionString"].ConnectionString; SqlConnection myConnection = new SqlConnection(strConnectionString); myConnection.Open(); string strCommandText3 = "UPDATE AutoLoan SET autoStatus ='" + approve + "'WHERE userID= '" + Session["userID"] + "';"; SqlCommand myCommand3 = new SqlCommand(strCommandText3, myConnection); myCommand3.ExecuteNonQuery(); string strCommandText = "SELECT custEmail From Customer WHERE userID= '" + Session["userID"] + "';"; SqlCommand myCommand = new SqlCommand(strCommandText, myConnection); myCommand.ExecuteNonQuery(); string strCommandText1 = "SELECT loginName From Customer WHERE userID= '" + Session["userID"] + "';"; SqlCommand myCommand1 = new SqlCommand(strCommandText1, myConnection); myCommand1.ExecuteNonQuery(); NetworkCredential myCred = new NetworkCredential("CHADBank2013@gmail.com", "627726627"); System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage(); message.To.Add(strCommandText); message.From = new MailAddress("CHADBank2013@gmail.com"); message.Subject = "CHAD Bank: Auto Loan Application Approved"; message.Body = "Hi " + strCommandText1 + "," + Environment.NewLine + Environment.NewLine + "Your application for your auto loan are approved, payment will start on the next month"; SmtpClient client = new SmtpClient("smtp.gmail.com"); client.Port = 587; client.Credentials = myCred; client.EnableSsl = true; client.Send(message); myConnection.Close(); } protected void gvDetail_SelectedIndexChanged(object sender, EventArgs e) { GridViewRow row = gvDetail.SelectedRow; Session["userID"] = row.Cells[10].Text; } </code></pre> <p>}</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload