CI 묻고 답하기

제목 CI 메일 발송 질문드립니다.
카테고리 CI 2, 3
글쓴이 야근싫어요 작성시각 2020/04/07 17:00:04
댓글 : 1 추천 : 0 스크랩 : 0 조회수 : 9408   RSS

CI 메뉴얼을 보면서 하나하나씩 공부를 하고있습니다.

메일을 보내던중에 도저히 해결할수가 없어서 여기에 도움을 청합니다.

 

/config/폴더에 email.php라는 것을 만들었습니다.

그리고 아래와 같이 내용을 넣었습니다.

 

<?php
$config['mailtype'] = 'html';
$config['protocol'] = 'smtp';
$config['charset'] = 'utf-8';
$config['smtp_host'] = 'smtp.gmail.com';
$config['smtp_user'] = '메일아이디@gmail.com';
$config['smtp_pass'] = '비밀번호';
$config['smtp_port'] = '587';
$config['smtp_timeout'] = 10;
//$config['smtp_crypto'] = 'ssl';
$config['smtp_crypto'] = 'tls';
$config['newline']  = "\r\n";

 

그리고 저 파일을 컨트롤러에서 읽어옵니다.

<?php
class Blog extends CI_Controller
{
    public function __construct()
    {
        parent::__construct();

        // 모델 사용
        $this->load->model('Blog_model');
    }

    public function insert()
    {
        $this->Blog_model->insert_entry();

        // 이메일 보내기
        $this->load->library('email');

        $this->email->from('메일아이디@naver.com', "테스터");
        $this->email->to('메일아이디@gmail.com');
        $this->email->subject('코드이그나이터에서 이메일 발송 테스트');
        $this->email->message('코드이그나이터 테스트');

        $this->email->send();
    }
}

그러고 메일을 보내면 

아래 캡쳐와 같이 오류가 발생합니다.

서버는 비트나미를 사용하고있습니다.

 

 


첨부파일 ci.PNG (61.0 KB)
 다음글 CI 메일발송 추가 질문. (1)
 이전글 CI 간단한 질문입니다. $data 변수..? (4)

댓글

변종원(웅파) / 2020/04/07 17:51:06 / 추천 0

ssl 관련 모듈이 활성화되지 않은 것 같네요. message에 해당하는 부분을 구글에서 검색해보시면 답 많이 나옵니다. 

저도 검색해볼라고 했는데 이미지가 작아서 글 내용이 잘 보이지가 않네요. ^^