/home/mjc1/public_html/manage/easybiil.mailing.send.ok.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<?
    
include "./category/common.php";

    if(!
$page)     $page       1; else $page++;
    if(!
$sendnum)  $sendnum    100;// ¹ß¼Û´ÜÀ§
    
if(!$success)  $success    0;
    if(!
$fault)    $fault      0;
//    if($s_content) $mh_content = $s_content;
//    else $s_content = $mh_content;



    // ¸ÞÀϸµ ÃÑ ¹ß¼Û ¼ö
    
if(!$total_num) {
        
            
$countSql " SELECT count(*) FROM tempmailer WHERE sendmail > 0 ";

        
$temp mysql_fetch_array(mysql_query($countSql));
        
$total_num $temp[0];
    }

    
$startnum = ($page-1) * $sendnum;

    if(!
$totalpage$totalpage = (int)(($total_num-1)/$sendnum)+1;

    
$header  "From: $admin_name <$admin_mail>\n";
    
$header .= "X-Sender: <$admin_mail>\n";
    
$header .= "X-Mailer: PHP ".phpversion()."\n";
    
$header .= "X-Priority: 1\n";
    
$header .= "Return-Path: <$admin_mail>\n";
    
$header .= "Reply-To: <$admin_mail>\n";
    
$header .= "MIME-Version: 1.0\n";
    
$header .= "Content-Type: text/html; charset=EUC-KR\n";


    echo 
"
    <body style='font-size:9pt;color:black'>
    <div align='center'>
    <form name='sendall' action='
$PHP_SELF' method='post'>
    <input type='hidden' name='mh_seq' value='
$mh_seq'>
    <input type='hidden' name='div' value='
$div'>
    <input type='hidden' name='div2' value='
$div2'>
    <input type='hidden' name='admin_name' value='
$admin_name'>
    <input type='hidden' name='admin_mail' value='
$admin_mail'>
    <input type='hidden' name='mh_subject' value='
$mh_subject'>
    <textarea name='s_content' cols=1 rows=1 style=width:1px;height:1px>
$s_content</textarea>
    <input type='hidden' name='sendnum' value='
$sendnum'>
    <input type='hidden' name='page' value='
$page'>
    <input type='hidden' name='total_num' value='
$total_num'>
    <input type='hidden' name='totalpage' value='
$totalpage'>

    <BR>
    <input type=button value=' ¸®½ºÆ® ' class=submit onclick=\"location.href='easytaxchange.php'\"><br>
    <HR width=95% color=cccccc>
    <b>¸ÞÀϸµ ÃÑ ¹ß¼Û ¼ö :</b> "
.number_format($total_num)." <br>
    <b>¸ÞÀÏ ¹ß¼Û ´ÜÀ§</b> : 
$sendnum  ¸í ´ÜÀ§·Î Àß¶ó¼­ ¹ß¼Û<br>
    <b>¸ÞÀÏ ¹ß¼Û ÆäÀÌÁö</b> : 
$page  / $totalpage <br>

    "
;


        
$sql  " SELECT * FROM tempmailer WHERE sendmail > 0 LIMIT $startnum$sendnum ";


    
$result mysql_query($sql);
    
$idx 1;

    while(
$row mysql_fetch_array($result)) {

$mh_content "<table border='0' cellpadding='0' cellspacing='0' align='center'>
    <tr>
        <td>
            <img src='http://www.mijinsoft.co.kr/html/mail/img/easybill.gif' border='0'>
        </td>
    </tr>
</table>
    <img width='1px' height='0px' src='http://www.mijinsoft.co.kr/etaxset.mail.process.php?idx=
$row[idx]'>
"
;
        if(@
mail($row[email],$mh_subject,$mh_content,$header)){
        
//if(true) {
            
echo "&nbsp;<font color=blue>$idx -> $row[email] </font><br>$mh_subject<br>";
            
$success++;
        } else {
            echo 
"&nbsp;<font color=red>$idx -> $row[email] </font><br>";
            
$fault++;
        }

        
usleep(300000);   // 0.5Ãʾ¿ ½¬¾ú´Ù°¡ ¸á º¸³»±â..
        
flush();

        
$idx++;
    }

    if(
$page == $totalpage) {

        echo 
"<BR>&nbsp;&nbsp;&nbsp;&nbsp;<font color=blue size=2><b>$success ¸í¿¡°Ô ¸ÞÀÏÀÌ ¹ß¼ÛµÇ¾ú½À´Ï´Ù.</b><BR></font>";
        if(
$fault>0) echo "<BR>&nbsp;&nbsp;&nbsp;&nbsp;<font color=red> $fault ¸í¿¡°Ô ¸ÞÀϹ߼۠½ÇÆÐÇß½À´Ï´Ù. </font><br>";
        echo 
"</div>";

        
mysql_query(" UPDATE tempmailer SET sendmail = '1'");

    } else {

        echo 
"&nbsp;&nbsp; * 10ÃÊ ÈÄ¿¡ ´ÙÀ½ $sendnum ¸í¿¡°Ô ¸ÞÀÏÀ» ¹ß¼ÛÇÕ´Ï´Ù.<br>
            <input type='hidden' name='success' value='
$success'>
            <input type='hidden' name='fault' value='
$fault'>
            <input type='submit' value=' ´ÙÀ½ 
$sendnum ¸í¿¡°Ô ¸ÞÀÏ ¹ß¼Û...' class='submit'>

            <script>
            function next_mail(){
                setTimeout('next_win()', 10000);
            }

            function next_win(){
                document.sendall.submit();
            }

            window.onload = next_mail;
            </script>
            </form>
            </div>"
;

    }
    exit;
?>