테스트 사이트 - 개발 중인 베타 버전입니다

으음..질문입니다..

Fatal error: Cannot redeclare mailer() in /경로/lib/mailer.lib.php on line 11
이렇게 에러를 뱉어냅니다.
 
원인이 무엇일지요??
-----------------
mailer.lib.php 파일
--------------------
<?
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" : "";
    $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";
    if ($file != "") {
        $boundary = uniqid("http://ww0ww.net/");
        $header .= "Content-type: MULTIPART/MIXED; BOUNDARY=\"$boundary\"\n\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";
    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";
            $header .= "\n";
            $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);
*/
// 파일을 첨부함
function attach_file($filename, $file)
{
    $fp = fopen($file, "r");
    $tmpfile = array(
        "name" => $filename,
        "data" => fread($fp, filesize($file)));
    fclose($fp);
    return $tmpfile;
}
?>

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

댓글 7개

어딘가에서 mailer() 함수가 중복되는 것으로 보입니다.....
그래요..?...어디서 중복된것일까...으..음.....이거참 하루도 바람잘날이없네요..ㅠ.ㅠ
참조 : 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
미치미티..^^...@ 참조 링크 쥑였습니다..감사합니다..
그거참..잘되던 것이 갑자기 저러니..당혹시럽더군요..
일전에 제가 같은 함수로 댓글을 썼던 기억이 나서.....^^

잘 되셨다니 감사합니당....^^
감사합니다...^^
매번 왕창왕창 걸겠습니다..()

게시판 목록

그누3질답

글쓰기
🐛 버그신고