Site İçerisinde Mail Gönderme İşlemi
-
Kolay gelsin asp.net bir site içerisinde mail göndermek istiyorum iletişim formunu doldurduklarında mail atıyor
normalde yapıyorum ama mailleri yandex maile taşıdım bu şekilde olanlarda hata veriyor
yazdığım kodu ve hatayı paylaşıyorum, hata nerede bulamadım
kod:SmtpClient smtp = new SmtpClient();
smtp.Credentials = new NetworkCredential("gonderen@siteadi.com", "şifre");
smtp.Port = 587; burda 25 i de denedim
smtp.EnableSsl = false; true bunuda denedim
smtp.Host = "smtp.yandex.com"; smtp.yandex.com.tr yi denedim
MailMessage mail = new MailMessage();
mail.From = new MailAddress("mail@siteadi.com");
mail.Subject = "başlık";
mail.Body = //mailin içeriği
mail.IsBodyHtml = true;
smtp.Send(mail);
hata :
sahinka tarafından 11/Eki/21 11:23 tarihinde düzenlenmiştir
System.Net.Mail.SmtpException: Posta gönderme hatası. ---> System.IO.IOException: Aktarma bağlantısından veriler okunamadı: Kurulan bir bağlantı, ana makinenizdeki yazılım tarafından iptal edildi. ---> System.Net.Sockets.SocketException: Kurulan bir bağlantı, ana makinenizdeki yazılım tarafından iptal edildi konum: System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags) konum: System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) --- İç özel durum yığını izlemesinin sonu --- konum: System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) konum: System.Net.DelegatedStream.Read(Byte[] buffer, Int32 offset, Int32 count) konum: System.Net.BufferedReadStream.Read(Byte[] buffer, Int32 offset, Int32 count) konum: System.Net.Mail.SmtpReplyReaderFactory.ReadLines(SmtpReplyReader caller, Boolean oneLine) konum: System.Net.Mail.SmtpReplyReaderFactory.ReadLine(SmtpReplyReader caller) konum: System.Net.Mail.CheckCommand.Send(SmtpConnection conn, String& response) konum: System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, MailAddress from, Boolean allowUnicode) konum: System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, Boolean allowUnicode, SmtpFailedRecipientException& exception) konum: System.Net.Mail.SmtpClient.Send(MailMessage message) --- -
smtp.EnableSsl = false; true bunuda denedim
System.Net.Mail.SmtpException: Yanlış komut sırası. Sunucu yanıtı şöyleydi: 5.5.4 Error: send AUTH command first. konum: System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response) konum: System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, MailAddress from, Boolean allowUnicode) konum: System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, Boolean allowUnicode, SmtpFailedRecipientException& exception) konum: System.Net.Mail.SmtpClient.Send(MailMessage message) konum: projeadi.Default.tbngonder_Click(Object sender, EventArgs e)bundaki hata bu şekilde
-
MailMessage mesaj = new MailMessage(); mesaj.From = new MailAddress("gonderen@mail.com"); mesaj.To.Add("gidecek@mail.com"); mesaj.Subject = "Mail Konusu"; mesaj.Body = "Mail İçeriği"; mesaj.IsBodyHtml = true; // giden mailin içeriği html olmasını istiyorsak true kalması lazım SmtpClient client = new SmtpClient("smtp.yandex.ru", 587); client.Credentials = new NetworkCredential("gonderen@mail.com", "gonderenSifre"); client.EnableSsl = true; client.Send(mesaj);
Yukardakini dene.
-
x-files bunu yazdı
MailMessage mesaj = new MailMessage(); mesaj.From = new MailAddress("gonderen@mail.com"); mesaj.To.Add("gidecek@mail.com"); mesaj.Subject = "Mail Konusu"; mesaj.Body = "Mail İçeriği"; mesaj.IsBodyHtml = true; // giden mailin içeriği html olmasını istiyorsak true kalması lazım SmtpClient client = new SmtpClient("smtp.yandex.ru", 587); client.Credentials = new NetworkCredential("gonderen@mail.com", "gonderenSifre"); client.EnableSsl = true; client.Send(mesaj);
Yukardakini dene.
System.Net.Mail.SmtpException: Yanlış komut sırası. Sunucu yanıtı şöyleydi: 5.5.4 Error: send AUTH command first. konum: System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response) konum: System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, MailAddress from, Boolean allowUnicode) konum: System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, Boolean allowUnicode, SmtpFailedRecipientException& exception) konum: System.Net.Mail.SmtpClient.Send(MailMessage message) konum:
yandex e yönlenmiş maillerde bu şekilde
sahinka tarafından 11/Eki/21 12:12 tarihinde düzenlenmiştir -
ilk kodundaki portu 465 den denermisin ssl aktifli
smtp.yandex.com.tr
cybermole tarafından 11/Eki/21 14:08 tarihinde düzenlenmiştir -
cybermole bunu yazdı
ilk kodundaki portu 465 den denermisin ssl aktifli
smtp.yandex.com.tr
System.Net.Mail.SmtpException: İşlem zaman aşımına uğradı. konum: System.Net.Mail.SmtpClient.Send(MailMessage message) konum:
yandexe girip outlook ayarlarınıda yaptım neden olmuyor bu acaba
-
sahinka bunu yazdı
yandexe girip outlook ayarlarınıda yaptım neden olmuyor bu acaba
yandex'in gönderim sırasında ince ayarları var, mesela zoho ile dene sorunsuzca çalışacak kodun :=)