コード例 #1
0
 static function send_mail($address, $title, $body)
 {
     global $_K, $kekezu;
     $basicconfig = $kekezu->_sys_config;
     $mail = new Phpmailer_class();
     if ($basicconfig['mail_server_cat'] == "smtp" and function_exists('fsockopen')) {
         $mail->IsSMTP();
         $mail->SMTPAuth = true;
         $mail->CharSet = strtolower($_K['charset']);
         $mail->Host = $basicconfig['smtp_url'];
         $mail->Port = $basicconfig['mail_server_port'];
         $mail->Username = $basicconfig['post_account'];
         $mail->Password = base64_decode($basicconfig['account_pwd']);
     } else {
         $mail->IsMail();
     }
     $mail->SetFrom($basicconfig['post_account'], $basicconfig['website_name']);
     if ($basicconfig['mail_replay']) {
         $mail->AddReplyTo($basicconfig['mail_replay'], $basicconfig['website_name']);
     }
     $mail->Subject = $title;
     $mail->AltBody = "To view the message, please use an HTML compatible email viewer!";
     $mail->MsgHTML($body);
     $address_email = db_factory::get_one('select username from ' . TABLEPRE . 'witkey_space where email="' . $address . '"');
     $mail->AddAddress($address, $address_email['username']);
     return $mail->Send();
 }
コード例 #2
0
    $kekezu->_cache_obj->set("keke_witkey_basic_config", $config_basic_arr);
    kekezu::admin_show_msg($_lang['submit_success'], $url, 3, '', 'success');
}
if (isset($email)) {
    $mail = new Phpmailer_class();
    if ($config_arr['mail_server_cat'] == "smtp") {
        $mail->IsSMTP();
        $mail->SMTPAuth = true;
        $mail->CharSet = $_K['charset'];
        $mail->Host = $config_arr['smtp_url'];
        $mail->Port = $config_arr['mail_server_port'];
        $mail->Username = $config_arr['post_account'];
        $mail->Password = $config_arr['account_pwd'];
    } else {
        $mail->IsMail();
    }
    $mail->SetFrom($config_arr['post_account'], $config_arr['website_name']);
    $mail->AddReplyTo($config_arr['mail_replay'], $config_arr['website_name']);
    $mail->Subject = $_lang['keke_mail_testing'];
    $mail->AltBody = "To view the message, please use an HTML compatible email viewer!";
    $body = $_lang['test_mail_sent_successfully'];
    $mail->MsgHTML($body);
    $mail->AddAddress($email, $config_arr['website_name']);
    if (!$mail->Send()) {
        echo "Mailer Error: " . $mail->ErrorInfo;
    } else {
        echo "Message sent!";
    }
    die;
}
require $template_obj->template(ADMIN_DIRECTORY . '/tpl/admin_config_' . $view);