CI 묻고 답하기

제목 이메일 전송 실패가 되는데, 원인을 알 수 있을까요?
글쓴이 엘렌 작성시각 2015/09/11 15:50:57
댓글 : 4 추천 : 0 스크랩 : 0 조회수 : 21911   RSS
안녕하세요. 이메일 테스트를 하는데 다음과 같이 에러가 나와서 문의 드려요..
기존의 사용을 하고 있었는데 아래와 같이 에러가 발생하는데 원인을 모르겠어요..
어제까지 이메일 전송이 되었는데 오늘 출근 후 이런 상태입니다.. 도움 부탁드릴게요.. 
도메인클럽측에 문의를 드렸는데 모르겠다는 답변을 받은 상태예요...

A PHP Error was encountered

Severity: Warning

Message: fsockopen(): unable to connect to mail5.domainclub.kr:25 (Connection timed out)

Filename: libraries/Email.php

Line Number: 1689


    public function sendguideemail2(){
        //email setting
        
        $config['protocol'] = 'smtp';
        $config['smtp_host'] = 'mail5.domainclub.kr';
        $config['smtp_port'] = '25';
        $config['smtp_user'] = '보내는메일계정@이메일도메인.com;
        $config['smtp_pass'] = '비밀번호';
        $config['smtp_timeout'] = '10';
        $config['wordwrap'] = TRUE;
        $config['mailtype'] = 'html';
        $config['charset'] = 'utf-8';

        $this->load->library('email');
        $this->email->initialize($config);

        $this->email->from('보내는메일@보내는메일 도메인', '보내는사람이름');
        $this->email->to('받는메일@naver.com','받는사람이름');

        $this->email->subject('메일 제목');

        $message = file_get_contents("http://xxx.bbbb.com/abc.html");
        $this->email->message($message);
        $this->email->set_alt_message('이메일 주소가 존재하지 않아 가입 문서 발송에 실패하였습니다.');
        if (!$this->email->send()) {

        }
        echo $this->email->print_debugger();
    }




에러를 조금더 추가한다면.. 다음과 같습니다.The following SMTP error was encountered: 110 Connection timed out
Unable to send data: AUTH LOGIN
Failed to send AUTH LOGIN command. Error: 
Unable to send data: MAIL FROM:
from: 
The following SMTP error was encountered: 
Unable to send data: RCPT TO:
to: 
The following SMTP error was encountered: 
Unable to send data: DATA
data: 
The following SMTP error was encountered: 



 
 다음글 Unable to locate the specified... (16)
 이전글 초보 질문이 있습니다. rest풀 방식의 유알엘 성격(... (5)

댓글

한대승(불의회상) / 2015/09/11 16:12:35 / 추천 0
mail5.domainclub.kr:25 (Connection timed out)

이 메시지로 미루어 보건데 이메일 서버에 접속이 안된거 아닐까요?
들국화 / 2015/09/11 18:26:30 / 추천 0
smtp 서버 연결시간 초과네요.
mail5.domainclub.kr:25 (Connection timed out) 서버가 살아 있는지 확인하시고요.
살아있다면 포트가 맞는지 데몬은 잘 돌아 가는지 보안설정 등으로 블록킹 되는건 아닌지 체크해 보세요.


메일서버로 연결이 안되니 보낼수 없는거네요.
IamMonk / 2015/09/11 20:52:53 / 추천 0
도움이 될라나 모르겠지만 아래의 코드를 /config/email.php 에 추가해 보세요.
저도 한번 애먹은 적이 있었는데 이걸로 해결했어요.
참고: http://forum.codeigniter.com/thread-39936-page-2.html
IamMonk / 2015/09/11 20:53:18 / 추천 0
$config['newline'] = "\r\n";
$config['crlf'] = "\r\n";