You are here

function messaging_phpmailer_settings_form in Messaging 6.4

Same name and namespace in other branches
  1. 6 messaging_phpmailer/messaging_phpmailer.module \messaging_phpmailer_settings_form()
  2. 6.2 messaging_phpmailer/messaging_phpmailer.module \messaging_phpmailer_settings_form()
  3. 6.3 messaging_phpmailer/messaging_phpmailer.module \messaging_phpmailer_settings_form()

Settings form callback

1 string reference to 'messaging_phpmailer_settings_form'
messaging_phpmailer_menu in messaging_phpmailer/messaging_phpmailer.module
Implementation of hook_menu().

File

messaging_phpmailer/messaging_phpmailer.module, line 51
HTML Mail using PHPMailer. Messaging method plug-in.

Code

function messaging_phpmailer_settings_form($form_state) {
  $form['messaging_phpmailer_smtp_server'] = array(
    '#title' => t('SMTP server'),
    '#type' => 'textfield',
    '#default_value' => variable_get('messaging_phpmailer_smtp_server', ini_get('SMTP')),
  );
  $form['messaging_phpmailer_auth'] = array(
    '#type' => 'fieldset',
    '#title' => t('SMTP Authentication'),
    '#description' => t('Leave blank if your SMTP server does not require authentication.'),
  );
  $form['messaging_phpmailer_auth']['messaging_phpmailer_smtp_username'] = array(
    '#type' => 'textfield',
    '#title' => t('Username'),
    '#default_value' => variable_get('messaging_phpmailer_smtp_username', ''),
    '#description' => t('SMTP Username.'),
  );
  $form['messaging_phpmailer_auth']['messaging_phpmailer_smtp_password'] = array(
    '#type' => 'textfield',
    '#title' => t('Password'),
    '#default_value' => variable_get('messaging_phpmailer_smtp_password', ''),
    '#description' => t('SMTP password.'),
  );
  $form['messaging_phpmailer_auth']['messaging_phpmailer_smtp_secure'] = array(
    '#type' => 'radios',
    '#title' => t('SMTP Security'),
    '#options' => array(
      '' => t('None'),
      'tls' => t('TLS'),
      'ssl' => t('SSL'),
    ),
    '#default_value' => variable_get('messaging_phpmailer_smtp_secure', ''),
    '#description' => t('What security, if any, to use for this SMTP connection.'),
  );
  $form['messaging_phpmailer_auth']['messaging_phpmailer_smtp_port'] = array(
    '#type' => 'textfield',
    '#title' => t('SMTP Port'),
    '#default_value' => variable_get('messaging_phpmailer_smtp_port', 25),
    '#description' => t('What port to use for the connection.'),
  );
  $form['messaging_phpmailer_attach'] = array(
    '#title' => t('Include attachments'),
    '#type' => 'checkbox',
    '#default_value' => variable_get('messaging_phpmailer_attach', 0),
    '#description' => t('If enabled, attachments will be included with outgoing messages.'),
  );
  $form['messaging_phpmailer_bcc'] = array(
    '#title' => t('Send all messages via BCC'),
    '#type' => 'checkbox',
    '#default_value' => variable_get('messaging_phpmailer_bcc', 0),
    '#description' => t('If enabled, all messages will be sent as BCCs and will have no "To:" address. '),
  );
  $form['messaging_phpmailer_debug'] = array(
    '#title' => t('Debug mode'),
    '#type' => 'radios',
    '#options' => array(
      t('Disabled'),
      t('Enabled'),
    ),
    '#default_value' => variable_get('messaging_phpmailer_debug', 0),
    '#description' => t('If enabled, PHPMailer debugging will be activated and all messages logged to watchdog.'),
  );
  return system_settings_form($form);
}