contact-form icon indicating copy to clipboard operation
contact-form copied to clipboard

Sending Fails Silently

Open putyourlightson opened this issue 8 years ago • 7 comments

Feature request: add error reporting to the controller action actionSendMessage() when email sending fails.

When email sending fails, there is no error reporting so the user may assume that the form was successfully sent when in fact it was not. This was a major issue on a site I recently worked on, in which the client lost a week of contact form submissions due to the sending failing silently.

putyourlightson avatar Sep 27 '17 07:09 putyourlightson

+1

jnaklaas avatar Oct 19 '17 09:10 jnaklaas

+1 - Did you ever figure out what was wrong? I'm dealing with something similar. :(

mstenquist avatar Apr 05 '18 04:04 mstenquist

+1

kaspar-allenbach avatar Apr 10 '18 10:04 kaspar-allenbach

This could be related to my thoughts of having form submissions be placed into a queue (with a cron set to trigger the queue consistently). I started looking into this but ended up using a different method for my needs.

I wasn't sure if it would be a best practice or not to use default Craft/Yii queue (or better to set up a separate one). For sensitive contact information I didn't want them stored in the DB forever, but wanted them until confirm of being processed correctly. If something goes wrong (e.g SMTP fails for whatever reason) then it can be debugged and the queue processed again.

sanscheese avatar Sep 04 '18 15:09 sanscheese

+1 for at least being able to check to let the user know the email is technically successfully sent. It's pretty critical now that both clients trying to contact a company as well as companies needing to know that a (potential) client is trying to reach them aren't aware that a mail couldn't even be sent.

Friksel avatar May 01 '20 15:05 Friksel

+1 in 2023

rezaplus avatar Feb 13 '23 09:02 rezaplus

+1 in 2024

In Mailer.php, mail is sent in this code block at Line 115:

foreach ($event->toEmails as $toEmail) {
            $message->setTo($toEmail);
            $mailer->send($message);
}

Seems from history of this post that this problem was handled in the earlier version of this plugin: [https://github.com/craftcms/contact-form/commit/0ef88f4f7c15d5b09e9c0b337c24fc58eec7488a](Fixes #95)

I am interested to know if there is a reason why this has not been implemented in the current version?

aldisaglobal avatar Jan 11 '24 18:01 aldisaglobal