// 메일 보내기
 function zd_mail($type, $to, $to_name, $from, $from_name, $subject, $comment, $cc="", $bcc="") {
  $recipient = "$to_name <$to>";

  if($type==1) $comment = nl2br($comment);

  $headers = "From: $from_name <$from>\n";
  $headers .= "X-Sender: <$from>\n";
  $headers .= "X-Mailer: PHP ".phpversion()."\n";
  $headers .= "X-Priority: 1\n";
  $headers .= "Return-Path: <$from>\n";

  if(!$type) $headers .= "Content-Type: text/plain; ";
  else $headers .= "Content-Type: text/html; ";
  $headers .= "charset=euc-kr\n";

  if($cc)  $headers .= "cc: $cc\n";
  if($bcc)  $headers .= "bcc: $bcc";


  $subject = stripslashes($subject);
  $comment = stripslashes($comment);
  //$comment = str_replace("\r\n","\n", $comment);

  return mail($recipient , $subject , $comment , $headers);

 }