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(); }
foreach ($_POST as $k => $v) { $config_basic_obj->setWhere("k = '{$k}'"); if ($k == 'account_pwd') { $config_basic_obj->setV(base64_encode($v)); } else { $config_basic_obj->setV($v); } $res += $config_basic_obj->edit_keke_witkey_basic_config(); } $kekezu->_cache_obj->gc(); kekezu::admin_system_log($_lang['email_config_param']); $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!";