SmtpClient Client = new SmtpClient("smtp.gmail.com", 25); Client.Credentials = new NetworkCredential("userName", "password"); MailMessage msg = new MailMessage(); msg.From = new MailAddress(textFrom.Text); msg.To.Add(new MailAddress(textTo.Text)); msg.Subject = textSubject.Text; msg.Body = textBody.Text; Client.Port = 587; Client.EnableSsl = true;