Hello People I want to send email from windows desktop application which I am creating in visual studio using language c#. Can anyone tell me how can i send email using windows app?
You can use gmail api for it here is the code for it MailMessage m = new MailMessage("mailidofSender", To); m.Subject = Subject; m.Body = Body; m.IsBodyHtml = true; SmtpClient smtp = new SmtpClient(); smtp.Host = "mail.google.com"; NetworkCredential authinfo = new NetworkCredential("mailidfrom", "YourPassword"); smtp.UseDefaultCredentials = false; smtp.Credentials = authinfo; smtp.Send(m); Code (markup):