コード例 #1
0
        private SmtpAyar smtpAyarGetir()
        {
            //Veritabanindan al.
            //Singleton olarak tasarla.
            _smtpAyar              = new SmtpAyar();
            _smtpAyar.Host         = "smtp.gmail.com";
            _smtpAyar.Port         = 587;
            _smtpAyar.KullaniciAdi = "";
            _smtpAyar.Sifre        = "";
            _smtpAyar.SslKullan    = true;
            _smtpAyar.Unvan        = "Test Kişisi";

            return(_smtpAyar);
        }
コード例 #2
0
        public SmtpClient SmtpClientBilgiGetir()
        {
            SmtpAyar smtpAyar = smtpAyarGetir();

            SmtpClient smtpClient = new SmtpClient();

            smtpClient.Host                  = smtpAyar.Host;
            smtpClient.Port                  = smtpAyar.Port;
            smtpClient.EnableSsl             = smtpAyar.SslKullan;
            smtpClient.UseDefaultCredentials = false;
            smtpClient.Credentials           = new NetworkCredential(smtpAyar.KullaniciAdi, smtpAyar.Sifre);
            smtpClient.DeliveryMethod        = SmtpDeliveryMethod.Network;
            //smtpClient.Timeout = 3000;

            return(smtpClient);
        }