으음..질문입니다..
Fatal error: Cannot redeclare mailer() in /경로/lib/mailer.lib.php on line 11
이렇게 에러를 뱉어냅니다.
원인이 무엇일지요??
-----------------
mailer.lib.php 파일
--------------------
<?
if (defined(__FILE__)) return;
define(__FILE__, TRUE);
if (defined(__FILE__)) return;
define(__FILE__, TRUE);
//==============================================================================
// 메일 관련 함수
//==============================================================================
// 메일 관련 함수
//==============================================================================
// 메일 보내기 (파일 여러개 첨부 가능)
function mailer($fname, $fmail, $to, $subject, $content, $type=0, $file="", $charset="EUC-KR", $cc="", $bcc="") {
// type : text=0, html=1, text+html=2
$fname = "=?$charset?B?" . base64_encode($fname) . "?=";
$subject = "=?$charset?B?" . base64_encode($subject) . "?=";
$charset = ($charset != "") ? "charset=$charset" : "";
$subject = "=?$charset?B?" . base64_encode($subject) . "?=";
$charset = ($charset != "") ? "charset=$charset" : "";
$header = "Return-Path: <$fmail>\n";
$header .= "From: $fname <$fmail>\n";
$header .= "Reply-To: <$fmail>\n";
if ($cc) $header .= "Cc: $cc\n";
if ($bcc) $header .= "Bcc: $bcc\n";
$header .= "MIME-Version: 1.0\n";
$header .= "X-Sender: <". $fmail . ">\n";
$header .= "X-Priority: 1\n";
$header .= "X-Mailer:ww0ww mailer 0.9 (ww0ww.net)\n";
$header .= "From: $fname <$fmail>\n";
$header .= "Reply-To: <$fmail>\n";
if ($cc) $header .= "Cc: $cc\n";
if ($bcc) $header .= "Bcc: $bcc\n";
$header .= "MIME-Version: 1.0\n";
$header .= "X-Sender: <". $fmail . ">\n";
$header .= "X-Priority: 1\n";
$header .= "X-Mailer:ww0ww mailer 0.9 (ww0ww.net)\n";
if ($file != "") {
$boundary = uniqid("http://ww0ww.net/");
$boundary = uniqid("http://ww0ww.net/");
$header .= "Content-type: MULTIPART/MIXED; BOUNDARY=\"$boundary\"\n\n";
$header .= "--$boundary\n";
}
$header .= "--$boundary\n";
}
if ($type) {
$header .= "Content-Type: TEXT/HTML; $charset\n";
if ($type == 2)
$content = nl2br($content);
} else {
$header .= "Content-Type: TEXT/PLAIN; $charset\n";
$content = stripslashes($content);
}
$header .= "Content-Transfer-Encoding: BASE64\n\n";
$header .= chunk_split(base64_encode($content)) . "\n";
$header .= "Content-Type: TEXT/HTML; $charset\n";
if ($type == 2)
$content = nl2br($content);
} else {
$header .= "Content-Type: TEXT/PLAIN; $charset\n";
$content = stripslashes($content);
}
$header .= "Content-Transfer-Encoding: BASE64\n\n";
$header .= chunk_split(base64_encode($content)) . "\n";
if ($file != "") {
foreach ($file as $f) {
$header .= "\n--$boundary\n";
$header .= "Content-Type: APPLICATION/OCTET-STREAM; name=\"$f[name]\"\n";
$header .= "Content-Transfer-Encoding: BASE64\n";
$header .= "Content-Disposition: inline; filename=\"$f[name]\"\n";
foreach ($file as $f) {
$header .= "\n--$boundary\n";
$header .= "Content-Type: APPLICATION/OCTET-STREAM; name=\"$f[name]\"\n";
$header .= "Content-Transfer-Encoding: BASE64\n";
$header .= "Content-Disposition: inline; filename=\"$f[name]\"\n";
$header .= "\n";
$header .= chunk_split(base64_encode($f[data]));
$header .= "\n";
}
$header .= "--$boundary--\n";
}
@mail($to, $subject, "", $header);
}
$header .= chunk_split(base64_encode($f[data]));
$header .= "\n";
}
$header .= "--$boundary--\n";
}
@mail($to, $subject, "", $header);
}
// 파일 첨부시
/*
$fp = fopen(__FILE__, "r");
$file[] = array(
"name"=>basename(__FILE__),
"data"=>fread($fp, filesize(__FILE__)));
fclose($fp);
*/
/*
$fp = fopen(__FILE__, "r");
$file[] = array(
"name"=>basename(__FILE__),
"data"=>fread($fp, filesize(__FILE__)));
fclose($fp);
*/
// 파일을 첨부함
function attach_file($filename, $file)
{
$fp = fopen($file, "r");
$tmpfile = array(
"name" => $filename,
"data" => fread($fp, filesize($file)));
fclose($fp);
return $tmpfile;
}
?>
function attach_file($filename, $file)
{
$fp = fopen($file, "r");
$tmpfile = array(
"name" => $filename,
"data" => fread($fp, filesize($file)));
fclose($fp);
return $tmpfile;
}
?>
댓글 7개
19년 전
어딘가에서 mailer() 함수가 중복되는 것으로 보입니다.....
MCLUB
19년 전
그래요..?...어디서 중복된것일까...으..음.....이거참 하루도 바람잘날이없네요..ㅠ.ㅠ
19년 전
참조 : http://www.sir.co.kr/bbs/board.php?bo_table=g3_qa&wr_id=37225&sca=&sfl=wr_subject%7C%7Cwr_content&stx=mailer%28%29&sop=and
MCLUB
19년 전
미치미티..^^...@ 참조 링크 쥑였습니다..감사합니다..
그거참..잘되던 것이 갑자기 저러니..당혹시럽더군요..
그거참..잘되던 것이 갑자기 저러니..당혹시럽더군요..
19년 전
일전에 제가 같은 함수로 댓글을 썼던 기억이 나서.....^^
잘 되셨다니 감사합니당....^^
잘 되셨다니 감사합니당....^^
MCLUB
19년 전
감사합니다...^^
매번 왕창왕창 걸겠습니다..()
매번 왕창왕창 걸겠습니다..()
18년 전
헤헤^^
게시판 목록
그누3질답
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 공지 | 15년 전 | 7783 | ||
| 9543 | 15년 전 | 3513 | ||
| 9542 | 15년 전 | 4939 | ||
| 9541 | 15년 전 | 5610 | ||
| 9540 | 15년 전 | 4147 | ||
| 9539 | 15년 전 | 3238 | ||
| 9538 |
watchme
|
15년 전 | 3531 | |
| 9537 |
황장군II
|
15년 전 | 3613 | |
| 9536 |
박카스1000
|
15년 전 | 2883 | |
| 9535 | 15년 전 | 2793 | ||
| 9534 |
돗단배123
|
15년 전 | 2704 | |
| 9533 |
박카스1000
|
15년 전 | 2600 | |
| 9532 | 15년 전 | 2846 | ||
| 9531 | 15년 전 | 3704 | ||
| 9530 |
pcline22
|
15년 전 | 2434 | |
| 9529 |
baoro
|
15년 전 | 2539 | |
| 9528 | 15년 전 | 2346 | ||
| 9527 | 15년 전 | 2597 | ||
| 9526 | 15년 전 | 2389 | ||
| 9525 | 15년 전 | 2869 | ||
| 9524 | 15년 전 | 2601 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기