godaddy호스팅 사용하시는 분들! 메일링 문제 해결이욤~ 정보
godaddy호스팅 사용하시는 분들! 메일링 문제 해결이욤~본문
고대디에서는 그누보드의 메일링이 작동 안하지요!
해서 라이브러리에 메일 함수를 오픈하셔서 아래 내용으로 바꾸시면 작동하실겁니다.
필요하신분들은 참조하셔요!~
// 메일 보내기 (파일 여러개 첨부 가능)
// type : text=0, html=1, text+html=2
function mailer($fname, $fmail, $to, $subject, $content, $type=0, $file="", $cc="", $bcc="")
{
global $config;
global $g4;
// 메일발송 사용을 하지 않는다면
if (!$config[cf_email_use]) return;
$fname = "=?$g4[charset]?B?" . base64_encode($fname) . "?=";
$subject = "=?$g4[charset]?B?" . base64_encode($subject) . "?=";
$header = "";
$header .= "From: $fname <$fmail>\r\n";
$header .= "Reply-To: $fmail\r\n";
if ($cc) $header .= "Cc: $cc\r\n";
if ($bcc) $header .= "Bcc: $bcc\r\n";
$header .= "X-Mailer: PHP/" . phpversion();
if ($file != "") {
$boundary = uniqid(time());
$header .= "Content-type: MULTIPART/MIXED; BOUNDARY=\"$boundary\"\n\n";
$header .= "--$boundary\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, $content, $header);
}
해서 라이브러리에 메일 함수를 오픈하셔서 아래 내용으로 바꾸시면 작동하실겁니다.
필요하신분들은 참조하셔요!~
// 메일 보내기 (파일 여러개 첨부 가능)
// type : text=0, html=1, text+html=2
function mailer($fname, $fmail, $to, $subject, $content, $type=0, $file="", $cc="", $bcc="")
{
global $config;
global $g4;
// 메일발송 사용을 하지 않는다면
if (!$config[cf_email_use]) return;
$fname = "=?$g4[charset]?B?" . base64_encode($fname) . "?=";
$subject = "=?$g4[charset]?B?" . base64_encode($subject) . "?=";
$header = "";
$header .= "From: $fname <$fmail>\r\n";
$header .= "Reply-To: $fmail\r\n";
if ($cc) $header .= "Cc: $cc\r\n";
if ($bcc) $header .= "Bcc: $bcc\r\n";
$header .= "X-Mailer: PHP/" . phpversion();
if ($file != "") {
$boundary = uniqid(time());
$header .= "Content-type: MULTIPART/MIXED; BOUNDARY=\"$boundary\"\n\n";
$header .= "--$boundary\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, $content, $header);
}
추천
0
0
댓글 3개
중간 헤더에
$type=2;
if ($type) {
$header .= "Content-Type: TEXT/HTML; charset=$g4[charset]\n";
if ($type == 2)
$content = nl2br($content);
} else {
$header .= "Content-Type: TEXT/PLAIN; charset=$g4[charset]\n";
$content = stripslashes($content);
}
넣으시면 html도 됩니다.
$type=2;
if ($type) {
$header .= "Content-Type: TEXT/HTML; charset=$g4[charset]\n";
if ($type == 2)
$content = nl2br($content);
} else {
$header .= "Content-Type: TEXT/PLAIN; charset=$g4[charset]\n";
$content = stripslashes($content);
}
넣으시면 html도 됩니다.
무한감사드립니다..
팁 감사합니다. 근데 위에 덧글에 씌인 소스 넣어도 html이 안보이는데 어떻게 하나요?