메일보내기시 첨부파일이 있으면 발송이 안됩니다.

메일보내기시 첨부파일이 있으면 발송이 안됩니다.

QA

메일보내기시 첨부파일이 있으면 발송이 안됩니다.

답변 1

본문

현재 첨부파일이 없을시 

 

메일보내기 발송은 정상적으로 이루어집니다.

 

파일을 첨부할시에는 메일이 발송됐다고 나오는데

 

실제 메일은 도착해 있지 않습니다.

 

파일이 있는경우만 메일이 작동이 안되니 답답하네요..

 

따로 설정을 해야 하는건가요??

 

bbs/formmail_send.php 파일입니다.

 

 


<?php
include_once('./_common.php');
include_once(G5_CAPTCHA_PATH.'/captcha.lib.php');
include_once(G5_LIB_PATH.'/mailer.lib.php');
 
if (!$config['cf_email_use'])
    alert('환경설정에서 "메일발송 사용"에 체크하셔야 메일을 발송할 수 있습니다.\\n\\n관리자에게 문의하시기 바랍니다.');
 
if (!$is_member && $config['cf_formmail_is_member'])
    alert_close('회원만 이용하실 수 있습니다.');
 
$to = base64_decode($to);
 
if (substr_count($to, "@") > 1)
    alert_close('한번에 한사람에게만 메일을 발송할 수 있습니다.');
 
 
if (!chk_captcha()) {
    alert('자동등록방지 숫자가 틀렸습니다.');
}
 
 
$file = array();
for ($i=1; $i<=$attach; $i++) {
    if ($_FILES['file'.$i]['name'])
        $file[] = attach_file($_FILES['file'.$i]['name'], $_FILES['file'.$i]['tmp_name']);
}
 
$content = stripslashes($content);
if ($type == 2) {
    $type = 1;
    $content = str_replace("\n", "<br>", $content);
}
 
// html 이면
if ($type) {
    $current_url = G5_URL;
    $mail_content = '<!doctype html><html lang="ko"><head><meta charset="utf-8"><title>메일보내기</title><link rel="stylesheet" href="'.$current_url.'/style.css"></head><body>'.$content.'</body></html>';
}
else
    $mail_content = $content;
 
mailer($fnick, $fmail, $to, $subject, $mail_content, $type, $file);
 
// 임시 첨부파일 삭제
if(!empty($file)) {
    foreach($file as $f) {
        @unlink($f['path']);
    }
}
 
//$html_title = $tmp_to . "님께 메일발송";
$html_title = '메일 발송중';
include_once(G5_PATH.'/head.sub.php');
 
alert_close('메일을 정상적으로 발송하였습니다.');
 
include_once(G5_PATH.'/tail.sub.php');
?>

이 질문에 댓글 쓰기 :

답변 1

웹 서버의 smtp 옵션을 확인해보세요. file upload 옵션이 off로 되어있으면 첨부파일이 보내지지 않더군요.
답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 179
© SIRSOFT
현재 페이지 제일 처음으로