function smtp_settings_form
Search API
6.x smtp.module | smtp_settings_form() |
5.x smtp.module | smtp_settings_form() |
File
- modules/
smtp/ smtp.module, line 44 - This is the main module file for SMTP, which will let us send emails using SMTP instead of PHP's mail() command.
Code
function smtp_settings_form() {
$form = array();
$form ['mark_top'] = array(
'value' => '<p>Configure the connection to your SMTP server here.</p>',
);
$form ['smtp_host'] = array(
'type' => 'textfield',
'label' => t('Host'),
'value' => variable_get('smtp_host', ''),
'description' => 'Ex: mail.example.com',
);
$form ['smtp_port'] = array(
'type' => 'textfield',
'label' => t('Port'),
'value' => variable_get('smtp_port', ''),
'size' => 10,
'description' => 'Ex: 25, 587, 465',
);
$form ['smtp_secure'] = array(
'type' => 'select',
'label' => t('Security'),
'value' => variable_get('smtp_secure', ''),
'options' => array('none' => 'none', 'tls' => 'TLS', 'ssl' => 'SSL'),
'description' => 'Ex: TLS',
);
$form ['smtp_username'] = array(
'type' => 'textfield',
'label' => t('Username'),
'value' => variable_get('smtp_username', ''),
'description' => '',
);
$form ['smtp_password'] = array(
'type' => 'textfield',
'label' => t('Password'),
'value' => variable_get('smtp_password', ''),
'description' => t('Note: The password will be stored within the database, in the Variables table.
Make sure you take the necessary precautions to ensure the security of your database.'),
);
$form ['smtp_from_email_address'] = array(
'type' => 'textfield',
'label' => t('From Email Address'),
'value' => variable_get('smtp_from_email_address', 'noreply@yourdomain.com'),
'description' => 'What is the default "from" address on emails we send?',
);
$form ['smtp_from_email_name'] = array(
'type' => 'textfield',
'label' => t('From Email Address'),
'value' => variable_get('smtp_from_email_name', 'NoReply - FlightPath'),
'description' => 'What is the default "from" name on emails we send?',
);
return $form;
}