private function send_welcome_mail() { $fTo = $this->id; $fFrom = smtp_get_admin_email(); if (empty($fFrom) || $fFrom == 'CLI') { $fFrom = $this->id; } $fSubject = Config::lang('pSendmail_subject_text'); $fBody = Config::read('welcome_text'); if (!smtp_mail($fTo, $fFrom, $fSubject, $fBody)) { $this->errormsg[] = Config::lang_f('pSendmail_result_error', $this->id); return false; } return true; }
* * Template Variables: -none- * * Form POST \ GET Variables: * * name * subject * message */ require_once 'common.php'; authentication_require_role('global-admin'); if ($CONF['sendmail'] != 'YES') { header("Location: main.php"); exit; } $smtp_from_email = smtp_get_admin_email(); if ($_SERVER['REQUEST_METHOD'] == "POST") { if (empty($_POST['subject']) || empty($_POST['message']) || empty($_POST['name'])) { $error = 1; flash_error($PALANG['pBroadcast_error_empty']); } else { $table_mailbox = table_by_key('mailbox'); $table_alias = table_by_key('alias'); $q = "select username from {$table_mailbox} union select goto from {$table_alias} " . "where goto not in (select username from {$table_mailbox})"; $result = db_query($q); if ($result['rows'] > 0) { mb_internal_encoding("UTF-8"); $b_name = mb_encode_mimeheader($_POST['name'], 'UTF-8', 'Q'); $b_subject = mb_encode_mimeheader($_POST['subject'], 'UTF-8', 'Q'); $b_message = base64_encode($_POST['message']); $i = 0;