I am trying to send 100 emails to myself asynchronously using the code below and I am receiving only few emails (5 emails) instead of 100 . Any help would be appreciated.
Thanks
using (var client = new SmtpClient())
{
int count = 100;
while (count > 0)
{
MailMessage msg = new MailMessage(email, email, "Test" + count, mailMessage.Body);
client.Host = smtpServer;
client.AuthenticationMethod = SmtpAuthentication.None;
client.BeginSendMessage(msg);
count--;
}
}
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.