私はメールがあるテキストボックス(textBox2
)を持っています:
thisemail@gmail.com,hello@yahoo.it,YesOrNo@gmail.com,etc..
メールを送信する機能があります:
private void button1_Click(object sender, EventArgs e)
{
var mail = new MailMessage();
var smtpServer = new SmtpClient(textBox5.Text);
mail.From = new MailAddress(textBox1.Text);
mail.To.Add(textBox2.Text);
mail.Subject = textBox6.Text;
mail.Body = textBox7.Text;
mail.IsBodyHtml = checkBox1.Checked;
mail.Attachments.Add(new Attachment(textBox9.Text));
var x = int.Parse(textBox8.Text);
smtpServer.Port = x;
smtpServer.Credentials = new System.Net.NetworkCredential(textBox3.Text, textBox4.Text);
smtpServer.EnableSsl = checkBox2.Checked;
smtpServer.Send(mail);
}
各メールに別々にメールを送ってほしい。つまり、私が を押して一度button1
に彼に電子メールを受け取り、あなたが終わるまで電子メールを送信するときです。どのようにできるのか?