diff --git a/smtp.module b/smtp.module
index 0290b11..edb97a9 100644
--- a/smtp.module
+++ b/smtp.module
@@ -73,7 +73,10 @@ function _smtp_mailer_send($variables) {
   $logger->info('Sending mail to: @to', ['@to' => $to]);
 
   // Try to send e-mail. If it fails, set watchdog entry.
-  if (!$mailer->Send()) {
+  try {
+    $mailer->Send();
+  }
+  catch (Exception $e) {
     $logger->error('Error sending e-mail from @from to @to: @error_message', [
       '@from' => $from,
       '@to' => $to,
diff --git a/src/Plugin/Mail/SMTPMailSystem.php b/src/Plugin/Mail/SMTPMailSystem.php
index 1f76b32..5aed985 100644
--- a/src/Plugin/Mail/SMTPMailSystem.php
+++ b/src/Plugin/Mail/SMTPMailSystem.php
@@ -2,15 +2,15 @@
 
 namespace Drupal\smtp\Plugin\Mail;
 
+use Drupal\Component\Utility\EmailValidator;
 use Drupal\Component\Utility\Unicode;
 use Drupal\Core\Logger\LoggerChannelFactoryInterface;
 use Drupal\Core\Mail\MailFormatHelper;
 use Drupal\Core\Mail\MailInterface;
 use Drupal\Core\Messenger\Messenger;
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
-use Egulias\EmailValidator\EmailValidator;
-use Symfony\Component\DependencyInjection\ContainerInterface;
 use Drupal\smtp\PHPMailer\PHPMailer;
+use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
  * Modify the drupal mail system to use smtp when sending emails.
@@ -44,7 +44,7 @@ class SMTPMailSystem implements MailInterface, ContainerFactoryPluginInterface {
   /**
    * Email validator.
    *
-   * @var Egulias\EmailValidator\EmailValidator
+   * @var \Drupal\Component\Utility\EmailValidator
    */
   protected $emailValidator;
 
@@ -61,7 +61,7 @@ class SMTPMailSystem implements MailInterface, ContainerFactoryPluginInterface {
    *   The logger object.
    * @param \Drupal\Core\Messenger\Messenger $messenger
    *   The messenger object.
-   * @param \Egulias\EmailValidator\EmailValidator $emailValidator
+   * @param \Drupal\Component\Utility\EmailValidator $emailValidator
    *   The messenger object.
    */
   public function __construct(array $configuration, $plugin_id, $plugin_definition, LoggerChannelFactoryInterface $logger, Messenger $messenger, EmailValidator $emailValidator) {
@@ -140,7 +140,7 @@ class SMTPMailSystem implements MailInterface, ContainerFactoryPluginInterface {
     $subject = $message['subject'];
 
     // Create a new PHPMailer object - autoloaded from registry.
-    $mailer = new PHPMailer();
+    $mailer = new PHPMailer(TRUE);
 
     // Turn on debugging, if requested.
     if ($this->smtpConfig->get('smtp_debugging') && \Drupal::currentUser()->hasPermission('administer smtp module')) {
diff --git a/tests/src/Unit/Plugin/Mail/SMTPMailSystemTest.php b/tests/src/Unit/Plugin/Mail/SMTPMailSystemTest.php
index d38c590..b62a711 100644
--- a/tests/src/Unit/Plugin/Mail/SMTPMailSystemTest.php
+++ b/tests/src/Unit/Plugin/Mail/SMTPMailSystemTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\smtp\Unit\Plugin\Mail;
 
+use Drupal\Component\Utility\EmailValidator;
 use Drupal\Core\Config\Config;
 use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\Core\Logger\LoggerChannelFactoryInterface;
@@ -9,7 +10,6 @@ use Drupal\Core\Messenger\Messenger;
 use Drupal\Core\StringTranslation\TranslationInterface;
 use Drupal\smtp\Plugin\Mail\SMTPMailSystem;
 use Drupal\Tests\UnitTestCase;
-use Egulias\EmailValidator\EmailValidator;
 use Prophecy\Argument;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
