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("[email protected]",ToEmail,"Password reset", message);
msg.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient("smtp.gmail.com", 587);
smtp.UseDefaultCredentials = true;
smtp.Credentials = new NetworkCredential("[email protected]", "pswd");
smtp.EnableSsl = true;
smtp.Send(msg);