Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- HP 신제품
- IE8
- DDos 전용 백신
- php
- 이클립스 설정
- ddos
- Ajax
- 한메일
- XP 설치
- IE 8
- jQuery
- 윈도우 7
- 오즈 옴니아
- VMware
- Live Mesh
- HP
- 오좀니아
- 한메일 pop
- Windows 7
- USB 레지스트리
- 삼성 메모리
- Internet Explorer 8
- VMwareTools
- PDA
- 이클립스
- 옴니아2
- 한메일 smtp
- 이클립스 플러그인
- 파워블로그
- 파블애드
Archives
- Today
- Total
엉망진창
php 전체 메일 본문
원문
<?
include('../../control/stdlib.inc') ;
$connid = connect2db() ;
$mailheaders .= "Return-Path: $from\r\n";
$mailheaders .= "From: $rn <$from>\r\n";
$mailheaders .= "X-Mailer: InoS Mailer\r\n";
$mailheaders .= "Reply-To: $from \r\n";
$mailheaders .= "Content-Type:text/html;charset=euc-kr \n";
$db_result = mysql_query("select email from 테이블명 order by num limit 0,150 ") ;
$db_total = mysql_num_rows($db_result);
if(!$db_total){
echo("<br><br>");
echo("<font style='font-size:9pt;' color=green><center>메일을 보낼 회원이 없습니다.</center></font>");
echo("<br>");
exit;
}
if ($userfile && $userfile_size) {
$filename=basename($userfile_name);
$result=fopen($userfile,"r");
$file=fread($result,$userfile_size);
fclose($result);
if ($userfile_type == "")
{
$userfile_type = "application/octet-stream";
}
$boundary = "--------" . uniqid("part");
$mailheaders .= "MIME-Version: 1.0\r\n";
$mailheaders .= "Content-Type: multipart/mixed; boundary=\"$boundary\"";
$bodytext = "This is a multi-part message in MIME format.\r\n\r\n";
$bodytext .= "--$boundary\r\n";
$bodytext .= "Content-Type: text/html; charset=euc-kr\r\n";
$bodytext .= "Content-Transfer-Encoding: 8bit\r\n\r\n";
$bodytext .= nl2br(stripslashes($body)) . "\r\n\r\n";
$bodytext .= "--$boundary\r\n";
$bodytext .= "Content-Type: $userfile_type; name=\"$filename\"\r\n";
$bodytext .= "Content-Transfer-Encoding: base64\r\n\r\n";
$bodytext .= ereg_replace("(.{80})","\\1\r\n",base64_encode($file));
$bodytext .= "\r\n--$boundary--" . "\r\n";
}
else {
$bodytext = stripslashes($body);
}
for($counter=0;$counter<$db_total; $counter++)
{
$user_id = mysql_result($db_result, $counter, "email");
mail($user_id,$subject,$bodytext,$mailheaders);
}
echo("<br><br>");
echo("<font style='font-size:9pt;' color=green><center> 총 $db_total 명에게 메일을 성공적으로 보냈습니다.</font></center>");
echo("<center><p><a href='newsletter_test.php'> <img src=/icon/first.gif border=0></a></center>");
echo("<br><br>");
?>
<?
include('../../control/stdlib.inc') ;
$connid = connect2db() ;
$mailheaders .= "Return-Path: $from\r\n";
$mailheaders .= "From: $rn <$from>\r\n";
$mailheaders .= "X-Mailer: InoS Mailer\r\n";
$mailheaders .= "Reply-To: $from \r\n";
$mailheaders .= "Content-Type:text/html;charset=euc-kr \n";
$db_result = mysql_query("select email from 테이블명 order by num limit 0,150 ") ;
$db_total = mysql_num_rows($db_result);
if(!$db_total){
echo("<br><br>");
echo("<font style='font-size:9pt;' color=green><center>메일을 보낼 회원이 없습니다.</center></font>");
echo("<br>");
exit;
}
if ($userfile && $userfile_size) {
$filename=basename($userfile_name);
$result=fopen($userfile,"r");
$file=fread($result,$userfile_size);
fclose($result);
if ($userfile_type == "")
{
$userfile_type = "application/octet-stream";
}
$boundary = "--------" . uniqid("part");
$mailheaders .= "MIME-Version: 1.0\r\n";
$mailheaders .= "Content-Type: multipart/mixed; boundary=\"$boundary\"";
$bodytext = "This is a multi-part message in MIME format.\r\n\r\n";
$bodytext .= "--$boundary\r\n";
$bodytext .= "Content-Type: text/html; charset=euc-kr\r\n";
$bodytext .= "Content-Transfer-Encoding: 8bit\r\n\r\n";
$bodytext .= nl2br(stripslashes($body)) . "\r\n\r\n";
$bodytext .= "--$boundary\r\n";
$bodytext .= "Content-Type: $userfile_type; name=\"$filename\"\r\n";
$bodytext .= "Content-Transfer-Encoding: base64\r\n\r\n";
$bodytext .= ereg_replace("(.{80})","\\1\r\n",base64_encode($file));
$bodytext .= "\r\n--$boundary--" . "\r\n";
}
else {
$bodytext = stripslashes($body);
}
for($counter=0;$counter<$db_total; $counter++)
{
$user_id = mysql_result($db_result, $counter, "email");
mail($user_id,$subject,$bodytext,$mailheaders);
}
echo("<br><br>");
echo("<font style='font-size:9pt;' color=green><center> 총 $db_total 명에게 메일을 성공적으로 보냈습니다.</font></center>");
echo("<center><p><a href='newsletter_test.php'> <img src=/icon/first.gif border=0></a></center>");
echo("<br><br>");
?>
'Study_Web > PHP' 카테고리의 다른 글
php 메일 (첨부파일가능) (0) | 2007.06.08 |
---|---|
그누보드4에서의 멀티업로드 (3) | 2007.05.01 |
[펌]실시간 쪽지 PHP (0) | 2007.04.23 |
php 함수 일부 (0) | 2007.04.19 |
[펌] XAMPP - Apache MySQL PHP., 설치없이쓰는 APM환경 (0) | 2007.03.16 |