En iyi yanıtlayıcılar
E posta onayı yapamıyorum

Soru
-
Ben e-postay onayı yapmak istiyorum fakat hata alıyorum bu hatayı alma sebebim nedir ?
SMTP sunucusu güvenli bir bağlantı gerektiriyor veya istemcinin kimliği doğrulanmadı. Sunucu yanıtı şöyleydi: 5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM [AM4PR0101CA0051.eurprd01.prod.exchangelabs.com]
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Net.Mail;
namespace Hastane_Programı
{
public partial class Form5 : Form
{
public Form5()
{
InitializeComponent();
}
int sayi;
Random rnd = new Random();
private void btngönder_Click(object sender, EventArgs e)
{
sayi = rnd.Next(1000, 10000);
MailMessage msj = new MailMessage();
SmtpClient client = new SmtpClient();
client.Credentials = new System.Net.NetworkCredential("nurettin_bakar@hotmail.com", "Onay Kodu");
client.Port = 587;
client.Host = "smtp.live.com";
client.EnableSsl = true;
msj.To.Add(txteposta.Text);
msj.From = new MailAddress("nurettin_bakar@hotmail.com", "Onay Kodu");
msj.Subject = "Güvenlik Kodu";
msj.Body = sayi.ToString();
client.Send(msj);
MessageBox.Show("Mail Gönderildi");
}
private void btndoğrula_Click(object sender, EventArgs e)
{
if (txtonay.Text == sayi.ToString())
{
label3.Text = "Güvenlik Doğrulandı";
label3.ForeColor = Color.Green;
}
else
{
label3.Text = "Güvenlik Kodu Yanlış";
label3.ForeColor = Color.Red;
}
}
}
}
Yanıtlar
-
NetworkCredential ifadesinde Onay Kodu yazan yere mail adresinizin parolasını yazmalısınız.
Sorunuzun yanıtı bu ise "Yanıt olarak işaretle"yerek siz de forumun işleyişine katkıda bulununuz...
- Yanıt Olarak İşaretleyen Nurettinn 2 Ağustos 2018 Perşembe 14:16
Tüm Yanıtlar
-
-
NetworkCredential ifadesinde Onay Kodu yazan yere mail adresinizin parolasını yazmalısınız.
Sorunuzun yanıtı bu ise "Yanıt olarak işaretle"yerek siz de forumun işleyişine katkıda bulununuz...
- Yanıt Olarak İşaretleyen Nurettinn 2 Ağustos 2018 Perşembe 14:16