I have DisplayFor Field where I show data from table.
I need to send Email to User (using his Email that are my value in DisplayFor)
I wrote this code in Controller to Send Email.
Here it is:
public ActionResult SendEmail(SmartSolutions.Models.Clients _objModelMail, string email)
{
MailMessage mail = new MailMessage();
mail.To.Add(email);
mail.From = new MailAddress(_objModelMail.From = "[email protected]");
mail.Subject = _objModelMail.Subject = "Данные для входа";
string Body = _objModelMail.Body = "Ваши данные для входа это ваш Email"+" Ваш пароль"+_objModelMail.Password;
mail.Body = Body;
mail.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com";
smtp.Port = 587;
smtp.UseDefaultCredentials = false;
smtp.Credentials = new System.Net.NetworkCredential
("********", "*********");// Enter seders User name and password
smtp.EnableSsl = true;
smtp.Send(mail);
return View("SendEmail", _objModelMail );
}
It works. I try to send value from DisplayFor to method this is string email
So in view I have this code
<td style="text-align: center;">
@Html.DisplayFor(modelItem => item.Email,null,"email")
</td>
But when I tap submit button it says me this

If i change DisplayFor to EditorFor, all ok.
Model of Clients
public int ID { get; set; }
[Required]
[Display(Name = "Email")]
[EmailAddress]
public string Email { get; set; }
[Display(Name = "Ф.И.О")]
public string UserName { get; set; }
[Display(Name = "Должность")]
public string Position { get; set; }
[Required]
[DataType(DataType.Password)]
[Display(Name = "Пароль")]
public string Password { get; set; }
public string From { get; set; }
public string Subject { get; set; }
public string Body { get; set; }
How I can do this for DisplayFor ?