다중선택메일ver1.0 정보
메일 다중선택메일ver1.0첨부파일
본문
특정인에 대한 메일 보내기입니다.
얼마전에 질문답변 게시판에 이 글을 올렸었는데.
그때 도와주신 분들께 감사를 드립니다.
사용법은 mail.php와 mailjob.php를 bbs/admin/ 경로에 덮어 씌우세요.
mail에서 선택목록을 지정을 하고 mailjob에서 그 목록을 받아들입니다.
일단 성별선택까지 밖에 만들지 못하였으나. 이것을 이용하면 다중 멀티메일을 쓸수 있겠군요.
더나은 업그래이드를 해주시기바랍니다.
//////////////////mail.php
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
define("_DOCTYPE_", "STYLE");
define("_GNUADMIN_", "DEFAULT");
include "./bbs/admin/admin.lib.php";
$menu = "menu020";
include "./bbs/admin/head.php";
?>
<table border="0" width="499" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="499" height="34" bgcolor="#809CC3">
<p align="center"><b><a href="http://127.0.0.1/gnu3/?doc=bbs/admin/maill.php"><font color="white">1.일반전체메일 보내기</font></a></b></p>
</td>
</tr>
</table>
<p> </p>
<table width="499" align=center cellpadding="0" cellspacing="0" border="0">
<form name=fmbmail method=post action='<?="./?doc=bbs/admin/mailjob.php"?>'><colgroup width=250 align=center><colgroup width=250 align=center>
<tr>
<td width="499" height="30" bgcolor="#809CC3" colspan="2">
<p align="center"><font color="white"><b>2.검색필드에서 보내기</b></font></p>
</td>
</tr>
<tr>
<td width="104" bgcolor="#809CC3" height="30">
<p align="center"><font color="white"><b>필드내용</b></font></p>
</td>
<td width="395" style="border-color:rgb(128,156,195); border-style:none;" height="30">
<p align="left"> 회원메일 대상</p>
</td>
</tr>
/////////////아래서부서 복합 회원선택검색
<tr>
<td width="104" bgcolor="#809CC3" height="30">
<p align="center"><font color="white"><b>회원이름</b></font></p>
</td>
<td width="395" style="border-color:rgb(128,156,195); border-style:none;" height="30">
<p align="left"> <input type=text name='mb_name' size="21" class=is autocomplete='off'>단어 포함</p>
</td>
</tr>
<tr>
<td class=ct width="104" bgcolor="#809CC3" height="30">
<p align="center"><font color="white"><b>성별선택</b></font></p>
</td>
<td width="395" style="border-color:rgb(128,156,195); border-style:none;" height="30">
<p align="left"> <select name=mb_sex_select onchange='this.form.mb_sex.value=this.value' class=select>
<option value="0">선택-------------------</option>
<option value="M">남자</option>
<option value="F">여자</option>
</select>
</p>
</td>
</tr>
<tr>
<td class=ct width="104" bgcolor="#809CC3"></td>
<td height=30 width="395" style="border-color:rgb(128,156,195); border-style:none;">
<p align="left"> <input type=text class=is name='mb_sex' size="22" value='<?=$mb_sex?>'>단어 포함</p>
</td>
</tr>
</tr>
<tr>
<td class=ct width="104" bgcolor="#809CC3" height="30">
<p align="center"><font color="white"><b>결혼유무</b></font></p>
</td>
<td width="395" style="border-color:rgb(128,156,195); border-style:none;" height="30">
<p align="left"> <select name=mb_married_select onchange='this.form.mb_married.value=this.value' class=select>
<option value="0">선택-------------------</option>
<option value="M">기혼</option>
<option value="S">미혼</option>
</select>
</p>
</td>
</tr>
<tr>
<td class=ct width="104" bgcolor="#809CC3"></td>
<td height=30 width="395" style="border-color:rgb(128,156,195); border-style:none;">
<p align="left"> <input type=text class=is name='mb_married' size="22" value='<?=$mb_sex?>'>단어 포함</p>
</td>
</tr>
/////////////아래서부서 복합 회원선택검색 끝
</tr>
</table>
<p><div align=center>
<input type=submit value=' 확 인 '></div>
</form>
<? include "./bbs/admin/tail.php"; ?>
////////////////끝
/////////////////////mailjob.php
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
define("_DOCTYPE_", "STYLE");
define("_GNUADMIN_", "DEFAULT");
include "./bbs/admin/admin.lib.php";
$menu = "menu020";
include "./bbs/admin/head.php";
?>
<table width=100% align=center cellpadding=3 cellspacing=1 class=tablebg>
<form name=fmbmail method=post action='<?="./?doc=bbs/admin/mailsend.php"?>'>
<colgroup width=250 align=center>
<colgroup width='' align=center>
<tr class='subject subjectbg ht' align=center>
<td>메일리스트</td>
<td>e-mail 제목, 내용</td>
</tr>
<tr class='content contentbg'>
<td>
<span style='height:42'></span>메일링 서비스 미가입자<br>탈퇴, 접근차단 회원은 제외
<textarea name='emails' class=textarea rows='20' style='width:99%;' required itemname='e-mail'></textarea>
</td>
<td>
<span style='height:22'></span>
제목 : <input type=text class=input name=subject size=60 required itemname='제목'><br>
<input type=radio name=text value='0' checked>TEXT
<input type=radio name=text value='1'>HTML
<input type=radio name=text value='2'>HTML+BR
<input type=checkbox name=test value='1' checked>테스트
<textarea name='content' class=textarea rows='20' style='width:99%;' required itemname='내용'></textarea></td>
</tr>
</table>
<p>
<div align=center>
<input type=submit value=' 확 인 '>
</div>
</form>
<?
// 이름에 특정 단어 포함
if ($mb_name != "")
$sql_where .= " and mb_name like '%$mb_name%' ";
// mb_sex선택받기
if ($mb_sex != "")
$sql_where .= " and mb_sex like '%$mb_sex%' ";
// mb_ mb_married선택받기
if ($mb_married != "")
$sql_where .= " and mb_married like '%$mb_married%' ";
$mail = "";
$return = "";
$sql = " select mb_email from $cfg[table_member]
where mb_leave_date = ''
and mb_intercept_date = ''
$sql_where";
$result = sql_query($sql);
for ($i=0; $row=mysql_fetch_array($result); $i++) {
if ($row[mb_email]) {
$mail .= $return . $row[mb_email];
$return = "\\n";
}
}
mysql_free_result($result);
echo "<script language='javascript'>document.fmbmail.emails.value = '$mail';</script>";
include "./bbs/admin/tail.php";
?>
//////////////////////////끝
0
