2012-06-25 4 views
1

내 Gmail 계정에서 동일한 Gmail 계정으로 이메일을 보내려면 아래 코드를 확인하십시오. 나는 그것을 실행할 때 전자 메일을 보낸다고 말합니다. 하지만 내받은 편지함에서 찾을 수 없습니다. 누구든지 문제가 무엇인지 제안 할 수 있습니까?'받은 편지함에'보낸 메일이 있지만 아무것도 표시하지 않습니다. CodeIgniter and gmail

$config = Array(
     'protocol' => 'smtp', 
     'smtp_host' => 'ssl://smtp.googlemail.com', 
     'smtp_port' => 465, 
     'smtp_user' => '[email protected]', 
     'smtp_password' => '****', 
     'mailtype' => 'html', 
     'charset' => 'iso-8859-1' 
    ); 

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


    $this->email->set_newline("\r\n"); 

    $this->email->from('[email protected]','Prajakta'); 
    $this->email->to('[email protected]'); 
    $this->email->subject('This is a test email'); 
    $this->email->message('It is working. Great!! yey'); 

    if($this->email->send()) 
    { 
     echo 'Your email was sent successfully'; 

    } 
    else 
    { 
     show_error($this->email->print_debugger()); 
    } 

나는 머큐리로 동작하는 Xampp를 가지고 있으며 머큐리 S SMTP 서버 매개 변수를 설정했다. 나는 정말로 이메일이 통과하지 않고있는 이유를 해석하지 않는다? 누군가이 문제를 도와 줄 수 있습니까?

+0

디버그 메시지 (print_debugger)를 인쇄하여 도움이되는지 확인하십시오. –

+0

@ SérgioMichels 나는 print_debugger를 시도했다. "Prajakta" 오는 길 : 그냥 명백히에서 메시지 를 표시 회신 대상을 "[email protected]" X-보낸 사람 : [email protected] X-우편 : CodeIgniter의 X-우선 순위 : 3 (일반) 메시지 ID : <[email protected]> MIME 버전 : 1.0 콘텐츠 형식 : 텍스트/일반; charset = utf-8 콘텐츠 전송 인코딩 : 8bit =? utf-8? Q? This_is_a_test_email? = 작동 중입니다. 큰!! yey – user1016310

+0

SSL을 사용할 때 보통 localhost에서 메일을 보내지 않습니다. 서버에서 보내보십시오. – prograshid

답변

0
function sendMail() 
{ 
    $config = Array(
    'protocol' => 'smtp', 
    'smtp_host' => 'ssl://smtp.googlemail.com', 
    'smtp_port' => 465, 
    'smtp_user' => '[email protected]', // change it to yours 
    'smtp_pass' => 'xxx', // change it to yours 
    'mailtype' => 'html', 
    'charset' => 'iso-8859-1', 
    'wordwrap' => TRUE 
); 

     $message = ''; 
     $this->load->library('email', $config); 
     $this->email->set_newline("\r\n"); 
     $this->email->from('[email protected]'); // change it to yours 
     $this->email->to('[email protected]');// change it to yours 
     $this->email->subject('Resume from JobsBuddy for your Job posting'); 
     $this->email->message($message); 
     if($this->email->send()) 
    { 
     echo 'Email sent.'; 
    } 
    else 
    { 
    show_error($this->email->print_debugger()); 
    } 

} 
관련 문제