function sent_qblog_comment_notice($page, $data) { global $script, $qblog_comment_check, $admin_email; global $qblog_title; $r_page = rawurlencode($page); //管理者メルアド必須 if (trim($admin_email) === '') { return FALSE; } require LIB_DIR . 'simplemail.php'; $smail = new SimpleMail(); $data['id'] = 'qbcomment_' . $data['id']; //for #hash $data['url'] = $script . '?' . $r_page; $data['body'] = $data['msg']; $data['datetime'] = date('Y年m月d日 H時i分s秒'); $ptns = $smail->mksearch($data); $rpls = $smail->mkreplace($data); $ptns[] = '<%header%>'; $rpls[] = 'ブログにコメントがありました'; $ptns[] = '<%footer%>'; $rpls[] = $qblog_comment_check ? 'よろしければ承認してください。' : ''; $ptns[] = '<%blog_title%>'; $rpls[] = $qblog_title; $subject_fmt = '[<%blog_title%>] ブログに新しいコメントがあります。'; $body_fmt = <<<EOM <%header%> ブログ名:<%blog_title%> 記事:<%url%> 日時: <%datetime%> お名前: <%name%> タイトル: <%title%> コメント: <%body%> <%footer%> ---- <%url%>#<%id%> EOM; //設定 $notifier = 'QHM'; $smail->set_params($notifier, $admin_email); $smail->set_to('', $admin_email); $smail->set_subject($subject_fmt); //管理者へ送信 $smail->replace_send($ptns, $rpls, $body_fmt); //TODO: お名前サーバーや、GoogleAppsへ対応 return TRUE; }
function dl_sendmail($email, $filename, $title) { global $smtp_auth, $smtp_server, $google_apps, $google_apps_domain; $qm = get_qm(); $xsubject = $title == '' ? $qm->replace('plg_dlbutton.subject', '') : $title; $xmsg = $qm->replace('plg_dlbutton.mail_body', $filename); $xheader = "From: " . $email . "\n"; $xparameter = "-f" . $email; //Mail send setting if ($google_apps && preg_match('/.*' . $google_apps_domain . '$/', $email)) { $mail = new Qdmail(); $mail->smtp(true); $param = array('host' => 'ASPMX.L.GOOGLE.com', 'port' => 25, 'from' => $email, 'protocol' => 'SMTP', 'user' => 'root@' . $google_apps_domain, 'pass' => $passwd); $mail->smtpServer($param); $mail->to($email); $mail->subject($xsubject); $mail->from($email); $mail->text($xmsg); $return_flag = $mail->send(); } else { $mail = new SimpleMail(); $mail->set_params('', $email); $mail->set_to('', $email); $mail->set_subject($xsubject); $mail->send($xmsg); } }