Try our conversational search powered by Generative AI!

When submitting multiple forms simultaneously, sometimes emails not sent

Found in

EPiServer.Forms 4.14.1

Fixed in

EPiServer.Forms 4.15.1

(Or a related package)

Created

Jul 11, 2018

Updated

Aug 13, 2018

Area

Built-in elements

State

Closed, Fixed and tested


Description

Steps to reproduce
1. Create a Form with a text and send button and add a "Send email after form submission".
2. Add some placeholders in the email, so you can see the text from the form, like #summary# and #Text#.
3. Submit the form from two different browsers at the same time. (Might have to do this a couple of times. Try and open both browsers in incognito mode).

Expected:
Should send email.

Actual:
Sometimes emails aren't sent. Can see this in the log:
*ERROR EPiServer.Forms.Core.PostSubmissionActor.PostSubmissionActorBase: Failed to send email
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.Send(MailMessage message)
at EPiServer.Forms.Implementation.Actors.SendEmailAfterSubmissionActor.SendMessage(EmailTemplateActorModel emailConfig)
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.Send(MailMessage message)
at EPiServer.Forms.Implementation.Actors.SendEmailAfterSubmissionActor.SendMessage(EmailTemplateActorModel emailConfig)*