craftcms / contact-form

Add a simple contact form to your Craft CMS site.
https://plugins.craftcms.com/contact-form
MIT License
294 stars 93 forks source link

Sending Fails Silently #95

Open putyourlightson opened 7 years ago

putyourlightson commented 7 years ago

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.

jnaklaas commented 7 years ago

+1

mstenquist commented 6 years ago

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

kaspar-allenbach commented 6 years ago

+1

sanscheese commented 6 years ago

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.

Friksel commented 4 years ago

+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.

rezaplus commented 1 year ago

+1 in 2023

aldisaglobal commented 10 months ago

+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?