An asynchronous call is already in progress
See original GitHub issueSMTP it’s not implemented properly probably. I cannot send two messages simultaneously.
Unexpected Server Exception:
System.InvalidOperationException: An asynchronous call is already in progress. It must be completed or canceled before you can call this method.
at System.Net.Mail.SmtpClient.SendAsync(MailMessage message, Object userToken)
at FluentEmail.Smtp.SendMailEx.SendMailExImplAsync(SmtpClient client, MailMessage message, CancellationToken token)
at FluentEmail.Smtp.SmtpSender.SendAsync(IFluentEmail email, Nullable`1 token)
at FluentEmail.Core.Email.SendAsync(Nullable`1 token)
Take a look here: https://stackoverflow.com/questions/50036795/getting-error-while-sending-bulk-email-an-asynchronous-call-is-already-in-progr
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Getting error while sending bulk email "An asynchronous ...
Getting error while sending bulk email "An asynchronous call is already in progress. It must be completed or canceled before you can call...
Read more >C# – Why do we periodically get “An asynchronous call is ...
C# – Why do we periodically get “An asynchronous call is already in progress” when calling SmtpClient.Send .netc++smtpclient. We have some (synchronous) ...
Read more >Solved: An asynchronous call is already in progress error ...
Hi EE, I am trying to resolve a problem we're experiencing with the 'An asynchronous call is already in progress.' error when sending...
Read more >Send Email connector in logic App fails to send email due ...
InvalidOperationException: An asynchronous call is already in progress. It must be completed or canceled before you can call this method. at ...
Read more >Getting error while sending bulk email "An asynchronous call ...
[Solved]-Getting error while sending bulk email "An asynchronous call is already in progress. It must be completed or canceled before you can call...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have found the cause of the issue to be the SmtpClient is reused throughout the entire lifetime of the application. A fix can be made in applications without pulling my patch by explicitly using the function version of
AddSmtpSender
. For exampleAddSmtpSender(() => new SmtpClient("smtp.example.com", 25))
instead ofAddSmtpSender("smtp.example.com", 25)
.I already fixed this now. I configured a smtpclient before adding it to the
AddSmtpSender
function I fixed my error by configuring the smtpclient in theAddSmtpSender
function