Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions ajax/sendMail.json.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,28 @@
$mailform = $request['mailform'];

$subject = mb_encode_mimeheader($mailform->subject, "UTF-8", "Q");
$mailer = Mail::factory('mail');

$headers = array(
'Charset' => 'UTF-8',
'Content-Type' => 'text/plain; charset="UTF-8"',
'From' => $mailform->sender,
'To' => $mailform->recipient,
'Subject' => $subject);
'Subject' => $subject
);

if (!defined('MAIL_HOST')) $mailer = Mail::factory('mail');
else {
$params = array();
$params['host'] = MAIL_HOST;
$params['debug'] = true;
if (defined('MAIL_PORT')) $params['port'] = MAIL_PORT;
if (defined('MAIL_AUTH')) $params['auth'] = MAIL_AUTH;
if (defined('MAIL_USERNAME')) $params['username'] = MAIL_USERNAME;
if (defined('MAIL_PASSWORD')) $params['password'] = MAIL_PASSWORD;

$mailer = Mail::factory('smtp', $params);
$headers['From'] = MAIL_SENDER;
}


$retval = array();
Expand Down
9 changes: 9 additions & 0 deletions config.inc.php.template
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ define('STORE_NTLM_HASH', false);

define('PAGETITLE', 'example.com User Admin');

// Mail configuration
// set MAIL_HOST to use SMTP or don't define it to use mail()

// define('MAIL_HOST', '');
// define('MAIL_PORT', 587);
// define('MAIL_AUTH', true);
// define('MAIL_USERNAME', '');
// define('MAIL_PASSWORD', '');

define('MAIL_SENDER', 'webteam@example.com');
const MAIL_TEMPLATES = array(
'addUser' => array(
Expand Down