Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Im sending the email when the form is submitted, but it isn working. Whats wrong?

email form submitted working wrong
0

There’s a race condition here where the form may be getting submitted before the email image is downloaded. Once the form submit starts, the thread that’s downloading the image is killed. So, to ensure that your attack always works, you should delay the form submission a little bit. You can use addEventListener with an event handler such as function(evt) { evt.preventDefault(); … }. In this way, you can prevent the form submission until you’re ready to trigger it yourself.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123