C# Asp.Net ile Gmail smtp üzerinden mail gönderme yardım

  • Konbuyu başlatan Konbuyu başlatan mkrkls
  • Başlangıç tarihi Başlangıç tarihi
Kodla Büyü

mkrkls

Seçkin Üye
Seçkin Üye
Mesajlar
501
hata mesajı
the smtp server requires a secure connection or the client was not authenticated. the server response was 5.1.1 Authentication Required.

kodlar:

private static readonly string username = ConfigurationManager.AppSettings["username"];
private static readonly string password = ConfigurationManager.AppSettings["password"];


public void SendMail(string to, string from, string subject, string content)
{
this.content = content;
this.from = from;
this.subject = subject;
this.to = to;


SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com";
smtp.Port = 587;
smtp.EnableSsl = true;
smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
smtp.UseDefaultCredentials = false;
smtp.Credentials = new NetworkCredential(username, password);


MailMessage mail = new MailMessage(new MailAddress(from, "admin"), new MailAddress(to, "üye"));
mail.Subject = this.subject;
mail.Body = this.content;
mail.IsBodyHtml = true;

smtp.Send(mail);

}
 
the smtp server requires a secure connection or the client was not authenticated. the server response was 5.1.1 Authentication Required.
hata mesajında smtp sunucu güvenli bir bağlantı istiyor ya da istemci (yani sizin sunucu) yetkili değil. Sunucu cevabı yetki gerekli.
Diyor, yani anlayacağınız sunucunuz ile smtp sunucu arasında güvenli bir bağlantı sağlanmalı ya da küçük bir ihtimal ama sunucunuz smtp sunucudan ban yemiş olabilir. Hosting firmanız ile iletişime geçerseniz yardımcı olurlar diye düşünüyorum.
 
yakuphan' Alıntı:
the smtp server requires a secure connection or the client was not authenticated. the server response was 5.1.1 Authentication Required.
hata mesajında smtp sunucu güvenli bir bağlantı istiyor ya da istemci (yani sizin sunucu) yetkili değil. Sunucu cevabı yetki gerekli.
Diyor, yani anlayacağınız sunucunuz ile smtp sunucu arasında güvenli bir bağlantı sağlanmalı ya da küçük bir ihtimal ama sunucunuz smtp sunucudan ban yemiş olabilir. Hosting firmanız ile iletişime geçerseniz yardımcı olurlar diye düşünüyorum.

hocam teşekkürler
kullandığım hosting ücretsiz deneme amaçlı somee.com

ben yazdığım kodlarda değişiklik yapmak mı gerekli acaba diye konuyu açmıştım. gmail dediğiniz gibi denemelerim esnasında banlama yaptı
 
BBNET
Geri
Üst