Note that there are some explanatory texts on larger screens.

plurals
  1. POsend username in email
    primarykey
    data
    text
    <p>i send mail in user respective email address and when he receive mail he see info in mail like this </p> <p>docname= abc status= reject</p> <p>now i want also add username and want to show who approve their documents</p> <p>i save user name in session and then when any user login then his/her name visible in top right cornet and i save this name in session </p> <pre><code> Session["Login2"] = txt_username.Value; </code></pre> <p>now suppose supervisor login through their account and approve any documents and also send mail then when user receive mail he would be able to see mail like this </p> <pre><code> docname= abc status=reject username = john </code></pre> <p>email code</p> <pre><code> string DocName = ((Label)Repeater2.Items[i].FindControl("DocName")).Text; string emailId = ((Label)Repeater2.Items[i].FindControl("YourEamil")).Text; DropDownList dropdownvalue = ((DropDownList)Repeater2.Items[i].FindControl("DropDownList4")); string docname = String.Empty; string emailID = String.Empty; string dropdownvalues = String.Empty; if (DocName.ToString() != "") { docname = DocName.ToString(); } else { docname = "Unavailable"; } if (emailId.ToString() != "") { emailID = emailId.ToString(); } else { emailID = "Unavailable"; } if (dropdownvalue.SelectedItem.ToString() != "") { dropdownvalues = dropdownvalue.SelectedItem.ToString(); } else { dropdownvalues = "Unavailable"; } SendEmailUsingGmail(DocName, emailId, dropdownvalues); cmd.ExecuteNonQuery(); } } else { Supvisor.Text = "Error"; } if (mySQLconnection.State == ConnectionState.Open) { mySQLconnection.Close(); } } private void SendEmailUsingGmail(string DocName, string emailId, string dropdownvalue) { try { SmtpClient smtp = new SmtpClient(); smtp.Credentials = new NetworkCredential("ketyycute@gmail.com", "123213"); smtp.Port = 587; smtp.Host = "smtp.gmail.com"; smtp.EnableSsl = true; MailMessage message = new MailMessage(); message.From = new MailAddress("ketyycut@gmail.com"); message.To.Add(emailId); //message.To.Add(New MailAddress(toEmailAddress)); message.Subject = "Document Managment System=" + "DropDownList4" + dropdownvalue; message.Body = "DocName=" + DocName + " DropDownList4=" + dropdownvalue; smtp.Send(message); } catch (Exception ex) { Response.Write("Error occured: " + ex.Message.ToString()); } } </code></pre> <p>how i done this </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.
    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