Note that there are some explanatory texts on larger screens.

plurals
  1. POMail Sending Problem
    primarykey
    data
    text
    <pre><code> public void Main() { timer1.Interval = 10000; timer1.Elapsed += new ElapsedEventHandler(SaatMail); timer1.Start(); } public void SaatMail(object sender, ElapsedEventArgs e) { timer1.Stop(); //kayıt yapılan en son değeri dataread yardımıyla çekerek, mail gonder servisine gönderiyor. SqlConnection baglanti = new SqlConnection(@""); SqlCommand komut = new SqlCommand("select OtoMailID,Adet,BasTarih,Aciklama,Kime from OtoMail where Sonuc=0 ", baglanti); baglanti.Open(); SqlDataAdapter da = new SqlDataAdapter(); //komut.ExecuteNonQuery(); da.SelectCommand = komut; DataTable dt=new DataTable(); da.Fill(dt); foreach(DataRow dr in dt.Rows) { Sayi = Convert.ToInt32(dr["Adet"]); Kime = (dr["Kime"].ToString()); BasTarih = Convert.ToDateTime(dr["BasTarih"]); OtoMailID = Convert.ToInt32(dr["OtoMailID"]); Aciklama = (dr["Aciklama"].ToString()); SqlConnection baglanti5 = new SqlConnection(@""); SqlCommand ekle = new SqlCommand("update OtoMail set Sonuc=@Sonuc where OtoMailID=@OtoMailID ", baglanti5); baglanti5.Open(); mailgonder(Sayi, Kime, islemdeger, Aciklama); ekle.Parameters.AddWithValue("@Sonuc", 1); ekle.Parameters.AddWithValue("@OtoMailID", OtoMailID); ekle.ExecuteNonQuery(); islemdeger = 1; baglanti5.Close(); baglanti5.Dispose(); ekle.Dispose(); } timer1.Start(); } private void mailgonder(int Sayi, string Kime, int islemdeger, string Aciklama) { MailMessage mvMail = new MailMessage(); mvMail.To = Kime; mvMail.From = "info@info.com"; mvMail.Body = Aciklama; mvMail.Subject = "OTOMATİK BİLGİLENDİRME MAİL"; SmtpMail.SmtpServer = "mailserver.info.com"; int i = 0; while (i &lt; Sayi) { SmtpMail.Send(mvMail); i++; } } </code></pre> <p>Above function good working.But, I want to send mail one by one.For example,I want to send two mail 10-seconds intervals. Above function sending mail ,but continuous.How can I do that?</p> <p>Thanks in advance.</p> <p>Cheers,</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload