Sending Email is not working in server side but working in local system. I tried port 25 and 465 instead of 587. But it doesn't work .
MailMessage msg = new MailMessage("from@gmail.com",ToEmail,"Password reset", message);
msg.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient("smtp.gmail.com", 587);
smtp.UseDefaultCredentials = true;
smtp.Credentials = new NetworkCredential("from@gmail.com", "pswd");
smtp.EnableSsl = true;
smtp.Send(msg);