Exemplo n.º 1
0
 private void timer1_Tick(object sender, EventArgs e)
 {
     try
     {
         string email    = this.ltb_emaillist.SelectedItem.ToString().Split('/')[0];
         string password = this.ltb_emaillist.SelectedItem.ToString().Split('/')[1];
         //循环是用发信人列表发信,避免频繁发信被封号。
         if (currentCount % ltb_emaillist.Items.Count == 0)
         {
             this.ltb_emaillist.SelectedIndex = 0;
         }
         else
         {
             this.ltb_emaillist.SelectedIndex++;
         }
         this.currentCount++;
         //SendMail(this.txb_emailaddress.Text.Trim(), this.txb_subject.Text + " - " + currentCount, this.txb_content.Text, email, password);
         EWSServerwith15 eWSServerwith15 = new EWSServerwith15();
         eWSServerwith15.SendEmail();
         this.lbl_message.Text = "Already sent email count: " + currentCount;
     }
     catch (Exception ex)
     {
         this.lbl_message.Text = ex.Message;
     }
 }
Exemplo n.º 2
0
        private void SendAmailbyFirstSender()
        {
            string email    = this.ltb_emaillist.SelectedItem.ToString().Split('/')[0];
            string password = this.ltb_emaillist.SelectedItem.ToString().Split('/')[1];

            currentCount++;
            EWSServerwith15 eWSServerwith15 = new EWSServerwith15();

            eWSServerwith15.SendEmail();
            //SendMail(this.txb_emailaddress.Text.Trim(), this.txb_subject.Text + " - " + currentCount, this.txb_content.Text, email, password);
            this.lbl_message.Text = "The first mail has been sent successfully!";
        }