Exchange Server ile Mail Gönderme - c#

Merhaba Arkadaşlar,

Bu gün smtp üzerinden c# ta mail gönderme kodunu yazacağım. Şirket maili (Exchange Server) üzerinden mail göndereceksiniz.
Öncelikle SMTP hakkında biraz bilgi verelim;

Elektronik posta gönderme protokolü (Simple Mail Transfer Protocol), bir e-posta göndermek için sunucu ile istemci arasındaki iletişim şeklini belirleyen protokoldür. 

Gönderme işlemine geçelim;
Burada dikkat etmeniz gereken noktalar var. Domain ile belirtiğim alana sadece mail adresinizin @ işaretinden önceki kısmını yazmanız gerekmektedir. Ayrıca kodun alt tarafında exchance server




 public void MailGonder()
        {
            SmtpClient smtpClient = new SmtpClient();
            NetworkCredential basicCredential = new NetworkCredential("Domain", "Şifreniz");
            MailMessage message = new MailMessage();
            MailAddress fromAddress = new MailAddress("mailadresiniz@maildomain.com.tr");
            smtpClient.Host = "İp Adresinizi veya Mail domainizi yazınız";
            smtpClient.Port = 587; //Gönderici portudur.
            smtpClient.UseDefaultCredentials = false;
            smtpClient.Credentials = basicCredential;
            smtpClient.EnableSsl = true;
            message.From = fromAddress;
            message.Subject = "Konu kısmıdır.";
            message.IsBodyHtml = true; // HTML içeriğine izin verir
            message.Body = "icerik"; // İçeriği oluşturmaktadır.
            ServicePointManager.ServerCertificateValidationCallback = delegate(object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { return true; };
            message.To.Add("Gidecek kişinin mailini yazınız");
            smtpClient.Send(message);
        }

NOT:Mail gönderme ve alma işlemini başarılı bir şekilde gerçekleştirdik.

Ancak Default olarak Exchange Server tarafından bir kişinin dakika’da gönderebileceği posta sayısı 5 olarak limitlenmiştir.Bu sayıdan daha fazla kişiye mail atmak isterse “Message submission rate for this client has exceeded the configured limit” hata mesajı vermektedir.
Dolayısıyla Default olarak 5 olan receive connector limitlerini değiştirme talebinde bulunmamız gerekmektedir.İhtiyaca göre en az dakikada 20 olarak tekrardan set edilmesi gerekmektedir.

Yorumlar

  1. This is very informative blog, writing skill is very creative. Thanks for sharing this kinda articles.
    Germany VPS Hosting

    YanıtlaSil
  2. Bu yorum yazar tarafından silindi.

    YanıtlaSil
  3. Thanks for this tutorial, it works!! Here are some points you should pay attention to. You only need to write the part of your e-mail address before the @ sign in the field I specified with Domain. I’d recommend to customers a hosting plan Onlive Server. because it USA VPS Hosting and many more plans provides are at on very low-cost.

    YanıtlaSil
  4. I am very impressed with this article, all the information I have found is very good, internet is a very convenient medium in which every information can be found in depth, this blog is very important
    Thank you for giving this article, if you have any information related to server hosting or to buy a high-tech server, then contact
    You should know about USA VPS Hosting and how it can be important for this modern world. Thanks once again.

    YanıtlaSil

Yorum Gönder

Popüler Yayınlar