Пример #1
0
        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();
                    }
                }
        }
Пример #2
0
 private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     EmailLogin el = new EmailLogin();
     el.Show();
     this.Hide();
 }