2017-10-31 9 views
1

나는 codeigniter로 이메일을 보내려고합니다. 여기 은 email.php 설정 파일의 내용입니다.codeigniter 및 gmail 계정으로 메일을 보낼 수 없습니다.

<?php 

$config= 
    array(
     'protocol'=>'smtp', 
     'useragent'=>'Camerbitcoin', 
     'smtp_host'=>'smtp.gmail.com', 
     'smtp_user'=>'[email protected]', 
     'smtp_pass'=>'my password', 
     'smtp_port'=>'587', 
     'mailtype'=>'html', 

    ); 

여기에 이메일을 보내는 코드입니다.

$this->email->from('[email protected]','Compagny name'); 
        $this->email->to('[email protected]'); 
        $this->email->subject('Activation link'); 
        $this->email->message('Welcome .<br/>'); 
        $this->load->view('registration_success'); 
$this->email->send(); 

오류는 표시되지만 메일은 전송되지 않습니다.

+0

확인을 통해 메일 오류 '가되고, $ this-> email-> print_debugger()' –

답변

0

그것을 시도,

'smtp_host' => 'ssl://smtp.googlemail.com', 
'smtp_port' => 465, 
+0

그래서, 당신은 오류 출력이? 디버그가 필요하다면 $ mail-> SMTPDebug = 1; –

+0

이 있습니다. 다른 오류가 있습니다. ** bold ** PHP SMTP를 사용하여 전자 메일을 보낼 수 없습니다. 서버가이 방법으로 메일을 보내도록 구성되지 않았을 수 있습니다. ** bold ** –