관리자가 보내는 이메일 제목에 회원 이름이 보이게..
원본을 수정해야 하는 부담감이 있으나 조금더 신뢰성을 주는 듯해서
제목에 회원의 별명이나 이름이 출력되게 하자
adm/mail_select_update.php를 수정해야 합니다.
수정전================
// 메일내용 가져오기
$sql = "select ma_subject, ma_content from $g4[mail_table] where ma_id = '$ma_id' ";
$ma = sql_fetch($sql);
$subject = $ma[ma_subject];
$cnt = 0;
for ($i=0; $i<count($member_list); $i++) {
list($email, $mb_id, $name, $nick, $birth) = explode("||", trim($member_list[$i]));
$sw = ereg("[0-9a-zA-Z_]+(\.[0-9a-zA-Z_]+)*@[0-9a-zA-Z_]+(\.[0-9a-zA-Z_]+)*", $email);
// 올바른 메일 주소만
if ($sw == true) {
$cnt++;
$mb_md5 = md5($mb_id.$mb_email);
$content = $ma[ma_content];
$content = preg_replace("/{이름}/", $name, $content);
$content = preg_replace("/{별명}/", $nick, $content);
$content = preg_replace("/{회원아이디}/", $mb_id, $content);
$content = preg_replace("/{이메일}/", $email, $content);
$content = preg_replace("/{생일}/", (int)substr($birth,4,2).'월 '.(int)substr($birth,6,2).'일', $content);
$content = $content . "<hr size=0><p><span style='font-size:9pt; font-familye:굴림'>▶ 더 이상 정보 수신을 원치 않으시면 [<a href='$g4[url]/$g4[bbs]/email_stop.php?mb_id=$mb_id&mb_md5=$mb_md5' target='_blank'>수신거부</a>] 해 주십시오.</span></p>";
수정 후 =========================
// 메일내용 가져오기
$sql = "select ma_subject, ma_content from $g4[mail_table] where ma_id = '$ma_id' ";
$ma = sql_fetch($sql);
$cnt = 0;
for ($i=0; $i<count($member_list); $i++) {
list($email, $mb_id, $name, $nick, $birth) = explode("||", trim($member_list[$i]));
$sw = ereg("[0-9a-zA-Z_]+(\.[0-9a-zA-Z_]+)*@[0-9a-zA-Z_]+(\.[0-9a-zA-Z_]+)*", $email);
// 올바른 메일 주소만
if ($sw == true) {
$cnt++;
$mb_md5 = md5($mb_id.$mb_email);
$subject = $ma[ma_subject];
$subject = preg_replace("/{이름}/", $name, $subject);
$subject = preg_replace("/{별명}/", $nick, $subject);
$subject = preg_replace("/{회원아이디}/", $mb_id, $subject);
$subject = preg_replace("/{이메일}/", $email, $subject);
$subject = preg_replace("/{생일}/", (int)substr($birth,4,2).'월 '.(int)substr($birth,6,2).'일', $subject);
$content = $ma[ma_content];
$content = preg_replace("/{이름}/", $name, $content);
$content = preg_replace("/{별명}/", $nick, $content);
$content = preg_replace("/{회원아이디}/", $mb_id, $content);
$content = preg_replace("/{이메일}/", $email, $content);
$content = preg_replace("/{생일}/", (int)substr($birth,4,2).'월 '.(int)substr($birth,6,2).'일', $content);
$content = $content . "<hr size=0><p><span style='font-size:9pt; font-familye:굴림'>▶ 더 이상 정보 수신을 원치 않으시면 [<a href='$g4[url]/$g4[bbs]/email_stop.php?mb_id=$mb_id&mb_md5=$mb_md5' target='_blank'>수신거부</a>] 해 주십시오.</span></p>";
제목에 회원의 별명이나 이름이 출력되게 하자
adm/mail_select_update.php를 수정해야 합니다.
수정전================
// 메일내용 가져오기
$sql = "select ma_subject, ma_content from $g4[mail_table] where ma_id = '$ma_id' ";
$ma = sql_fetch($sql);
$subject = $ma[ma_subject];
$cnt = 0;
for ($i=0; $i<count($member_list); $i++) {
list($email, $mb_id, $name, $nick, $birth) = explode("||", trim($member_list[$i]));
$sw = ereg("[0-9a-zA-Z_]+(\.[0-9a-zA-Z_]+)*@[0-9a-zA-Z_]+(\.[0-9a-zA-Z_]+)*", $email);
// 올바른 메일 주소만
if ($sw == true) {
$cnt++;
$mb_md5 = md5($mb_id.$mb_email);
$content = $ma[ma_content];
$content = preg_replace("/{이름}/", $name, $content);
$content = preg_replace("/{별명}/", $nick, $content);
$content = preg_replace("/{회원아이디}/", $mb_id, $content);
$content = preg_replace("/{이메일}/", $email, $content);
$content = preg_replace("/{생일}/", (int)substr($birth,4,2).'월 '.(int)substr($birth,6,2).'일', $content);
$content = $content . "<hr size=0><p><span style='font-size:9pt; font-familye:굴림'>▶ 더 이상 정보 수신을 원치 않으시면 [<a href='$g4[url]/$g4[bbs]/email_stop.php?mb_id=$mb_id&mb_md5=$mb_md5' target='_blank'>수신거부</a>] 해 주십시오.</span></p>";
수정 후 =========================
// 메일내용 가져오기
$sql = "select ma_subject, ma_content from $g4[mail_table] where ma_id = '$ma_id' ";
$ma = sql_fetch($sql);
$cnt = 0;
for ($i=0; $i<count($member_list); $i++) {
list($email, $mb_id, $name, $nick, $birth) = explode("||", trim($member_list[$i]));
$sw = ereg("[0-9a-zA-Z_]+(\.[0-9a-zA-Z_]+)*@[0-9a-zA-Z_]+(\.[0-9a-zA-Z_]+)*", $email);
// 올바른 메일 주소만
if ($sw == true) {
$cnt++;
$mb_md5 = md5($mb_id.$mb_email);
$subject = $ma[ma_subject];
$subject = preg_replace("/{이름}/", $name, $subject);
$subject = preg_replace("/{별명}/", $nick, $subject);
$subject = preg_replace("/{회원아이디}/", $mb_id, $subject);
$subject = preg_replace("/{이메일}/", $email, $subject);
$subject = preg_replace("/{생일}/", (int)substr($birth,4,2).'월 '.(int)substr($birth,6,2).'일', $subject);
$content = $ma[ma_content];
$content = preg_replace("/{이름}/", $name, $content);
$content = preg_replace("/{별명}/", $nick, $content);
$content = preg_replace("/{회원아이디}/", $mb_id, $content);
$content = preg_replace("/{이메일}/", $email, $content);
$content = preg_replace("/{생일}/", (int)substr($birth,4,2).'월 '.(int)substr($birth,6,2).'일', $content);
$content = $content . "<hr size=0><p><span style='font-size:9pt; font-familye:굴림'>▶ 더 이상 정보 수신을 원치 않으시면 [<a href='$g4[url]/$g4[bbs]/email_stop.php?mb_id=$mb_id&mb_md5=$mb_md5' target='_blank'>수신거부</a>] 해 주십시오.</span></p>";
댓글 6개
madem
20년 전
제목에 {이름} 이렇게 해서 테스트가 오는데요. ㅠㅠ
내용에는 정상적으로 이름이 적히고요...
내용에는 정상적으로 이름이 적히고요...
20년 전
madem님// 감사합니다.
위의 소스는 전체 보내는 소스입니다.
adm/mail_test.php의 소스도 고치셔야 합니다. 아래 처럼 고쳐 주세요...
$sql = "select ma_subject, ma_content from $g4[mail_table] where ma_id = '$ma_id' ";
$ma = sql_fetch($sql);
$subject = $ma[ma_subject];
$subject = preg_replace("/{이름}/", $name, $subject);
$subject = preg_replace("/{별명}/", $nick, $subject);
$subject = preg_replace("/{회원아이디}/", $mb_id, $subject);
$subject = preg_replace("/{이메일}/", $email, $subject);
$subject = preg_replace("/{생일}/", (int)substr($birth,4,2).'월 '.(int)substr($birth,6,2).'일', $subject);
$content = $ma[ma_content];
$content = preg_replace("/{이름}/", $name, $content);
$content = preg_replace("/{별명}/", $nick, $content);
$content = preg_replace("/{회원아이디}/", $mb_id, $content);
$content = preg_replace("/{이메일}/", $email, $content);
$content = preg_replace("/{생일}/", (int)substr($birth,4,2).'월 '.(int)substr($birth,6,2).'일', $content);
위의 소스는 전체 보내는 소스입니다.
adm/mail_test.php의 소스도 고치셔야 합니다. 아래 처럼 고쳐 주세요...
$sql = "select ma_subject, ma_content from $g4[mail_table] where ma_id = '$ma_id' ";
$ma = sql_fetch($sql);
$subject = $ma[ma_subject];
$subject = preg_replace("/{이름}/", $name, $subject);
$subject = preg_replace("/{별명}/", $nick, $subject);
$subject = preg_replace("/{회원아이디}/", $mb_id, $subject);
$subject = preg_replace("/{이메일}/", $email, $subject);
$subject = preg_replace("/{생일}/", (int)substr($birth,4,2).'월 '.(int)substr($birth,6,2).'일', $subject);
$content = $ma[ma_content];
$content = preg_replace("/{이름}/", $name, $content);
$content = preg_replace("/{별명}/", $nick, $content);
$content = preg_replace("/{회원아이디}/", $mb_id, $content);
$content = preg_replace("/{이메일}/", $email, $content);
$content = preg_replace("/{생일}/", (int)substr($birth,4,2).'월 '.(int)substr($birth,6,2).'일', $content);
20년 전
wow....일단 스크랩부터 해 놓고....
감사합니다...^^
감사합니다...^^
coco
20년 전
감사합니다. 스크랩합니다^^
Tomahawk
20년 전
음
18년 전
감사합니다.
게시판 목록
그누4 팁자료실
그누보드4와 관련된 팁을 여러분들과 함께 공유하세요.
나누면 즐거움이 커집니다.
나누면 즐거움이 커집니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 109 | 20년 전 | 4582 | ||
| 108 | 20년 전 | 6023 | ||
| 107 | 20년 전 | 7692 | ||
| 106 | 20년 전 | 3686 | ||
| 105 |
|
20년 전 | 5307 | |
| 104 |
|
20년 전 | 3846 | |
| 103 | 20년 전 | 5366 | ||
| 102 |
yesmoa
|
20년 전 | 10247 | |
| 101 | 20년 전 | 6018 | ||
| 100 |
g6man
|
20년 전 | 3712 | |
| 99 | 20년 전 | 3193 | ||
| 98 | 20년 전 | 6046 | ||
| 97 | 20년 전 | 14558 | ||
| 96 | 20년 전 | 4042 | ||
| 95 |
|
20년 전 | 5503 | |
| 94 |
|
20년 전 | 8703 | |
| 93 |
|
20년 전 | 3431 | |
| 92 | 20년 전 | 4460 | ||
| 91 | 20년 전 | 5231 | ||
| 90 | 20년 전 | 7188 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기