File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -207,8 +207,8 @@ public function onPhpbuEnd(Event\App\End $event)
207207 $ this ->mailer ->addAddress ($ recipient );
208208 }
209209
210- if (! $ this ->mailer -> send () ) {
211- throw new Exception ( $ this ->mailer -> ErrorInfo );
210+ if ($ this ->transportType !== ' null ' ) {
211+ $ this ->sendMail ( );
212212 }
213213 }
214214 }
@@ -350,6 +350,22 @@ protected function setupSendmailMailer(array $options)
350350 // nothing to do here
351351 }
352352
353+ /**
354+ * Send the email
355+ *
356+ * @throws \phpbu\App\Exception
357+ */
358+ protected function sendMail ()
359+ {
360+ try {
361+ if (!$ this ->mailer ->send ()) {
362+ throw new Exception ($ this ->mailer ->ErrorInfo );
363+ }
364+ } catch (\Exception $ e ) {
365+ throw new Exception ($ e ->getMessage ());
366+ }
367+ }
368+
353369 /**
354370 * Return mail header html
355371 *
You can’t perform that action at this time.
0 commit comments