- 14 Ara 2022
- 27
- 1
selam. bir projemde kullanamam gereken mail gönderme işini bir türlü yapamadım. kodun tamamı aşşağıdadır. try, catch kullandım, kütüphanesinide ekledim fakat smtp güvenlik hatası veriyor.
MailMessage mail = new MailMessage();
SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com");
mail.From = new MailAddress("gmail hesabım");
mail.To.Add(textBox5.Text);
mail.Subject = "selam";
mail.Body = "selam";
SmtpServer.Port = 587;
SmtpServer.Credentials = new System.Net.NetworkCredential("gmail hesabım", "hesabımın şifresi");
SmtpServer.EnableSsl = true;
SmtpServer.Send(mail);
MailMessage mail = new MailMessage();
SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com");
mail.From = new MailAddress("gmail hesabım");
mail.To.Add(textBox5.Text);
mail.Subject = "selam";
mail.Body = "selam";
SmtpServer.Port = 587;
SmtpServer.Credentials = new System.Net.NetworkCredential("gmail hesabım", "hesabımın şifresi");
SmtpServer.EnableSsl = true;
SmtpServer.Send(mail);