CI 묻고 답하기

제목 smtp로 메일 발송시 파일첨부만 안됩니다.
카테고리 CI 2, 3
글쓴이 perfume 작성시각 2020/04/25 02:06:08
댓글 : 2 추천 : 0 스크랩 : 0 조회수 : 9557   RSS

항상 도움에 감사드립니다.

 

$config['protocol'] = 'smtp';

$config['smtp_host'] = $smtp_host;

$config['smtp_user'] = $smtp_user;

$config['smtp_pass'] = $smtp_pass;

$config['smtp_port'] = $smtp_port;

$config['smtp_timeout'] = 5;

$config['wrapchars'] = 76;

$config['charset'] = 'utf-8';

$config['validate'] = FALSE;

$config['priority'] = 3;

$config['crlf'] = "\r\n";

$config['newline'] = "\r\n";

$config['bcc_batch_mode'] = FALSE;

$config['bcc_batch_size'] = 200;

$config['mailtype'] = 'html';

$config['wordwrap'] = TRUE;

$this->email->initialize($config);

 

 

$to_mail = array( $mail_to );

$this->email->from( $smtp_user, $smtp_name );

$this->email->to( $to_mail );

$this->email->subject( $mail_subject );

$this->email->message( $mail_content );

$this->email->attach( $mail_attach, 'attachment', $mail_attach_name );

$this->email->send()

 

이렇게 메일을 보내고 있는데 첨부파일없이 메일만 가고 있습니다.

참고로, 첨부파일($mail_attach)은 서버에 파일이 실제 존재하고 있으며

서버에 있는 파일을 첨부해서 보내봐도 첨부파일만 가질 않습니다.

왜 그런걸까요?

 

 

 다음글 CI에서 $_REQUEST 변수를 항상 $request... (3)
 이전글 ci4 pager 문의드립니다. (1)

댓글

변종원(웅파) / 2020/04/25 07:44:09 / 추천 0
$mail_attach parh는 어떻게 되어있을까요? 절대? 상대경로?
perfume / 2020/04/25 08:51:38 / 추천 0

변종원(웅파)님 답변 감사드립니다.

상대경로로 하니까 되는군요. 이 생각을 왜 못했을까요? ㅠㅠ