public void SendEmail(String name, String content,String fromAdd, String password) { var smtp = new SmtpClient { Host = "smtp.gmail.com", Port = 587, EnableSsl = true, DeliveryMethod = SmtpDeliveryMethod.Network, Credentials = new NetworkCredential(fromAdd, password) }; using (var message = new MailMessage(fromAdd, "*****@*****.**") { Body = content }) { try { smtp.Send(message); } catch (SmtpException e) { EmailLogin el = new EmailLogin(); el.Show(); } } }
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { EmailLogin el = new EmailLogin(); el.Show(); this.Hide(); }