if($mode=='mailsend')
{
if(!$to) {
echo("
window.alert('받는 사람의 메일주소가 없읍니다. 주소를 입력해 주십시오')
history.go(-1)
"); exit;
}
if(!$subject) {
echo("
window.alert('메일 제목이 없습니다. 메일 제목을 입력해 주십시오.')
history.go(-1)
"); exit;
}
$mailheaders .= "Return-Path: $fromrn";
$mailheaders .= "From: $rn $from rn";
$mailheaders .= "X-Mailer: Gfew Interfacern";
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.0rn";
$mailheaders .= "Content-Type: multipart/mixed; boundary="$boundary"";
$bodytext = "This is a multi-part message in MIME format.rnrn";
$bodytext .= "--$boundaryrn";
$bodytext .= "Content-Type: text/html; charset=euc-krrn";
$bodytext .= "Content-Transfer-Encoding: 8bitrnrn";
$bodytext .= nl2br(stripslashes($body)) . "rnrn";
$bodytext .= "--$boundaryrn";
$bodytext .= "Content-Type: $userfile_type; name="$filename"rn";
$bodytext .= "Content-Transfer-Encoding: base64rnrn";
$bodytext .= ereg_replace("(.{80})","\1rn",base64_encode($file));
$bodytext .= "rn--$boundary" . "rn";
}
else {
$bodytext = stripslashes($body);
}
mail($to,$subject,$bodytext,$mailheaders);
echo(" 발송되었습니다.");
{
if(!$to) {
echo("
window.alert('받는 사람의 메일주소가 없읍니다. 주소를 입력해 주십시오')
history.go(-1)
"); exit;
}
if(!$subject) {
echo("
window.alert('메일 제목이 없습니다. 메일 제목을 입력해 주십시오.')
history.go(-1)
"); exit;
}
$mailheaders .= "Return-Path: $fromrn";
$mailheaders .= "From: $rn $from rn";
$mailheaders .= "X-Mailer: Gfew Interfacern";
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.0rn";
$mailheaders .= "Content-Type: multipart/mixed; boundary="$boundary"";
$bodytext = "This is a multi-part message in MIME format.rnrn";
$bodytext .= "--$boundaryrn";
$bodytext .= "Content-Type: text/html; charset=euc-krrn";
$bodytext .= "Content-Transfer-Encoding: 8bitrnrn";
$bodytext .= nl2br(stripslashes($body)) . "rnrn";
$bodytext .= "--$boundaryrn";
$bodytext .= "Content-Type: $userfile_type; name="$filename"rn";
$bodytext .= "Content-Transfer-Encoding: base64rnrn";
$bodytext .= ereg_replace("(.{80})","\1rn",base64_encode($file));
$bodytext .= "rn--$boundary" . "rn";
}
else {
$bodytext = stripslashes($body);
}
mail($to,$subject,$bodytext,$mailheaders);
echo(" 발송되었습니다.");