I can\'t understand why this code is not working. I get an error saying property can not be assigned
MailMessage mail = new MailMessage();
SmtpClient client
Initialize the MailMessage with sender and reciever's email addresses. It should be something like
string from = "codeforwin@gmail.com"; //Senders email
string to = "reciever@gmail.com"; //Receiver's email
MailMessage msg = new MailMessage(from, to);
Read the full code snippet of how to send emails in c#