이 응용 프로그램과 함께 작동하지 C#을 사용 WPF Windows 응용 프로그램, 내가받는 사람의 상당히 긴 목록에 이메일을 보내도록 노력하고 있어요smtpclient.sendasync 너무 많은 수신자
이다. 이 사람들이이 목록에 등록했기 때문에 이것은 처음에는 스팸이 아님을 밝힙니다.
smtpclient.sendasync를 사용하고 있습니다. 이것은 1 ~ 3 명에게 보낼 때 잘 작동하지만 전체 메일 링리스트로 보내면 작동하지 않습니다. 목록의 번호는 2623입니다. 오류 메시지는 없습니다. 영수증에서 이메일을받지 못한다는 것입니다. 이것은 스팸 일 것이기 때문에 예를 들어 100 명에게 보내는 것으로 테스트 할 수 없기 때문에 디버깅하는 것이 좋습니다.
아래 코드를 참조하십시오. 참고 스팸을 방지하기 위해 이메일 주소를 변경했습니다.
Int32 _MessageCount = 0;
MailMessage msg = new MailMessage();
SmtpClient client = new SmtpClient(Configuration.smtpServer);
string _PriorEMail = "";
msg.From = new MailAddress("[email protected]");
msg.To.Add (new MailAddress("[email protected]"));
// bcc to the list
foreach (string str in EmailToAddresses)
{
if (clsUtilities.IsAnEmail(str) == true && str != _PriorEMail)
{ // process only valid emails and avoid dups
_MessageCount += 1;
msg.Bcc.Add(new MailAddress(str));
_PriorEMail = str;
}
}
msg.Subject = EmailSubject;
msg.IsBodyHtml = true;
msg.Body = EmailBodyHtml;
client.SendAsync(msg,null);