.net - smtpclient.sendasync fails to work with too many recipients -
this application wpf windows application using c#,
i trying send email long list of recipients. let me state @ outset not spam these people have signed list.
i using smtpclient.sendasync. works fine in testing when send 1 3 people when send whole mailing list, fails work. number on list 2623. there no error message; it’s receipts don’t email. problem debug because can’t test by, example, sending 100 people because spamming.
see code below. note changed email addresses prevent spamming.
int32 _messagecount = 0; mailmessage msg = new mailmessage(); smtpclient client = new smtpclient(configuration.smtpserver); string _prioremail = ""; msg.from = new mailaddress("a@b.com"); msg.to.add (new mailaddress("a@b.com")); // bcc list foreach (string str in emailtoaddresses) { if (clsutilities.isanemail(str) == true && str != _prioremail) { // process valid emails , 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);
the limitation comes smtp server itself: set-up prevent sending emails huge amount of recipients, various reasons (from legal through business performance).
check provider of smtp server actual limitation. work around throttling operation, and/or using smtp server allows greater number of recipients.
see this iis documentation example: states if limit 100, , recipients list 105 addresses long, first 100 addresses processed.
Comments
Post a Comment