Skip to content

Commit ebae807

Browse files
committed
Catch Swift exceptions when sending form data via e-mail (see contao#6941)
1 parent 20827d3 commit ebae807

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

system/docs/CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ Contao Open Source CMS changelog
44
Version 3.3.0 (2014-05-XX)
55
--------------------------
66

7+
### Fixed
8+
Catch Swift exceptions when sending form data via e-mail (see #6941).
9+
710
### Fixed
811
Try all locale variations when loading TinyMCE (see #6952).
912

system/modules/core/forms/Form.php

+10-3
Original file line numberDiff line numberDiff line change
@@ -410,10 +410,17 @@ protected function processFormData($arrSubmitted, $arrLabels)
410410
}
411411

412412
$uploaded = strlen(trim($uploaded)) ? "\n\n---\n" . $uploaded : '';
413-
414-
// Send e-mail
415413
$email->text = \String::decodeEntities(trim($message)) . $uploaded . "\n\n";
416-
$email->sendTo($recipients);
414+
415+
// Send the e-mail
416+
try
417+
{
418+
$email->sendTo($recipients);
419+
}
420+
catch (\Swift_SwiftException $e)
421+
{
422+
$this->log('Form "' . $this->title . '" could not be sent: ' . $e->getMessage(), __METHOD__, TL_ERROR);
423+
}
417424
}
418425

419426
// Store the values in the database

0 commit comments

Comments
 (0)