You are here

function swiftmailer_get_encryption_options in Swift Mailer 7

Same name and namespace in other branches
  1. 8.2 includes/helpers/utilities.inc \swiftmailer_get_encryption_options()
  2. 8 includes/helpers/utilities.inc \swiftmailer_get_encryption_options()

Returns a list of available encryption options.

Return value

array A list of available encryption options.

1 call to swiftmailer_get_encryption_options()
swiftmailer_admin_transport_form in includes/pages/swiftmailer_admin_transport.inc
Form builder; the transport form.

File

includes/helpers/utilities.inc, line 48
This file contains general utility functions.

Code

function swiftmailer_get_encryption_options() {

  // Define a variable to hold the various encryption options.
  $encryption_options[0] = t('No Encryption');

  // Get available encryption options on this system.
  $system_transports = stream_get_transports();

  // Validate wether this system supports SSL.
  if (in_array('ssl', $system_transports)) {
    $encryption_options['ssl'] = t('SSL');
  }

  // Validate wether this system supports TLS.
  if (in_array('tls', $system_transports)) {
    $encryption_options['tls'] = t('TLS');
  }

  // Return available options.
  return $encryption_options;
}