여기 내 문제가 있습니다. 이메일 응용 프로그램에서 전자 메일을 보내고, 보내면 끝나면 서식있는 텍스트 상자에 메시지 상태를 씁니다. 여기에 문제가있다. 10 개의 이메일을 발송한다고 가정 할 때, 모든 반복에서 리치 텍스트 상자가 업데이트되지 않습니다. 10 개의 전자 메일이 모두 전송되면 보낸 메시지로 상자가 업데이트됩니다. 4 개의 루프를 거치면서 appliation이 고정 된 것처럼 보입니다.서식있는 텍스트 상자에 쓰기.
for (int count = 0; count < numEmailToSend; count++)
{
System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
if (typeSelectedItem == "text/html") { message.IsBodyHtml = true; }
if (typeSelectedItem == "text/plain") { message.IsBodyHtml = false; }
message.To.Add(emailAddress);
if (txtCC.Text != "")
{message.CC.Add(txtCC.Text);}
if (txtBCC.Text != "")
{message.Bcc.Add(txtBCC.Text);}
message.Subject = subject;
message.From = new System.Net.Mail.MailAddress(emailSender);
message.Body = body;
System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient(server);
rtbStatus.Text = rtbStatus.Text + "Starting to Send Message\r\n";
Thread.Sleep(avgDelay * 1000);
//smtp.Send(message);
smtp.SendAsync(message,1);
rtbStatus.Text = rtbStatus.Text + "Message Sent\r\n";
}
아이디어가 있으십니까?
어떻게하면 모든 링크가 있습니까? – Andy12
어떻게 작동합니까? – SLaks