diff --git a/includes/helpers/utilities.inc b/includes/helpers/utilities.inc
index 40885a6..ebab0fc 100644
--- a/includes/helpers/utilities.inc
+++ b/includes/helpers/utilities.inc
@@ -5,42 +5,6 @@
  */
 
 /**
- * Validates whether the Swift Mailer library is available at the provided path.
- *
- * @param string $path
- *   The path to the base directory of the Swift Mailer library
- *
- * @return mixed
- *   The provided path exluding leading and trailing slashes if the Swift Mailer
- *   library is available at the provided path, and otherwise FALSE.
- */
-function swiftmailer_validate_library($path) {
-  return TRUE;
-
-  // Remove leading slashes.
-  while (drupal_substr($path, 0, 1) === '/') {
-    $path = drupal_substr($path, 1);
-  }
-
-  // Remove trailing slashes.
-  while (drupal_substr($path, -1) === '/') {
-    $path = drupal_substr($path, 0, -1);
-  }
-
-  // Get the real path of the 'swift_required.php' file.
-  $real_path = DRUPAL_ROOT . '/' . $path . '/lib/swift_required.php';
-
-  // Returns whether the 'swift_required.php' file could be found.
-  if (file_exists($real_path)) {
-    return $path;
-  }
-  else {
-    return FALSE;
-  }
-
-}
-
-/**
  * Returns a list of available encryption options.
  *
  * @return array
diff --git a/src/Form/MessagesForm.php b/src/Form/MessagesForm.php
index b28d4e5..2002bbb 100644
--- a/src/Form/MessagesForm.php
+++ b/src/Form/MessagesForm.php
@@ -37,8 +37,6 @@ class MessagesForm extends ConfigFormBase {
       '#markup' => '<p>' . t('This page allows you to configure settings which determines how e-mail messages are created.') . '</p>',
     );
 
-    if (swiftmailer_validate_library($config->get('path', SWIFTMAILER_VARIABLE_PATH_DEFAULT))) {
-
       $form['format'] = array(
         '#type' => 'fieldset',
         '#title' => t('Message format'),
@@ -94,16 +92,7 @@ class MessagesForm extends ConfigFormBase {
         '#options' => swiftmailer_get_character_set_options(),
         '#default_value' => $config->get('character_set', SWIFTMAILER_VARIABLE_CHARACTER_SET_DEFAULT),
       );
-    }
-    else {
-
-      $form['message'] = array(
-        '#markup' => '<p>' . t('You need to configure the location of the Swift Mailer library. Please visit the !page
-          and configure the library to enable the configuration options on this page.',
-          array('!page' => _l(t('library configuration page'), 'admin/config/people/swiftmailer'))) . '</p>',
-      );
 
-    }
 
     return $form;
   }
diff --git a/src/Form/SettingsForm.php b/src/Form/SettingsForm.php
index a003f77..f97153f 100644
--- a/src/Form/SettingsForm.php
+++ b/src/Form/SettingsForm.php
@@ -40,10 +40,6 @@ class SettingsForm extends ConfigFormBase {
       '#markup' => '<p>' . t('This page allows you to configure settings which determines how e-mail messages are sent.') . '</p>',
     );
 
-    // Validate that the Swift Mailer library is available. Configuration options
-    // should only be displayed if the library is available.
-    if (swiftmailer_validate_library($config->get('path', SWIFTMAILER_VARIABLE_PATH_DEFAULT))) {
-
       $form['transport'] = array(
         '#id' => 'transport',
         '#type' => 'details',
@@ -231,16 +227,7 @@ class SettingsForm extends ConfigFormBase {
         '#description' => t('The absolute path to the spool directory.'),
         '#default_value' => $config->get('spool_directory', sys_get_temp_dir() . '/swiftmailer-spool'),
       );
-    }
-    else {
-
-      $form['message'] = array(
-        '#markup' => t('<p>You need to configure the location of the Swift Mailer library. Please visit the !page
-        and configure the library to enable the configuration options on this page.</p>',
-          array('!page' => \Drupal::l($this->t('library configuration page'), 'admin/config/people/swiftmailer'))),
-      );
-
-    }
+       
 
     return $form;
   }
diff --git a/swiftmailer.install b/swiftmailer.install
new file mode 100644
index 0000000..c276777
--- /dev/null
+++ b/swiftmailer.install
@@ -0,0 +1,18 @@
+<?php
+
+/**
+ * Implements hook_requirements().
+ */
+function swiftmailer_requirements($phase) {
+  $requirements = [];
+  if ($phase == 'install') {
+    if (!class_exists('Swift_Mailer')) {
+      $requirements['swiftmailer_library'] = [
+        'description' => t('Swiftmailer requires the external Swift Mailer library. The recommended way of solving this dependency is using the composer manager module.'),
+        'severity' => REQUIREMENT_ERROR,
+      ];
+    }
+  }
+
+  return $requirements;
+}
\ No newline at end of file
