MailMessage mail = new MailMessage();mail.From = new System.Net.Mail.MailAddress("apps@xxxx.com");// The important part -- configuring the SMTP clientSmtpClient smtp = new SmtpClient();smtp.Port = 587; // [1] You can try with 465 also, I always used 587 and got successsmtp.EnableSsl = true;smtp.DeliveryMethod = SmtpDeliveryMethod.Network; // [2] Added thissmtp.UseDefaultCredentials = false; // [3] Changed thissmtp.Credentials = new NetworkCredential(mail.From, "password_here"); // [4] Added this. Note, first parameter is NOT string.smtp.Host = "smtp.gmail.com";//recipient addressmail.To.Add(new MailAddress("yyyy@xxxx.com"));//Formatted mail bodymail.IsBodyHtml = true;string st = "Test";mail.Body = st;smtp.Send(mail);