CI 묻고 답하기

제목 smtp로 구글 메일 보내기가 에러가 나서요
글쓴이 kashou 작성시각 2013/11/20 18:45:22
댓글 : 1 추천 : 0 스크랩 : 0 조회수 : 24393   RSS
이게 웃긴게 테스트서버에서 user.customerdomain.com / shop.customerdomain.com 는 메일이 발송이 잘됩니다;;

근데 실제 서버에서는 user.customerdomain.com 은 잘 되는데, shop.customerdomain.com 에서는 발송이 실패되는데
내용이 아래와 같습니다. 유저사이트에서는 잘만 보내는데, 딜러사이트에서는 에러를 내뿜습니다;;


string(13717) "220 mx.google.com ESMTP vk17sm38324619pab.5 - gsmtp 
hello: 250-mx.google.com at your service, [1.234.21.175] 250-SIZE 35882577 250-8BITMIME 250-AUTH LOGIN PLAIN XOAUTH XOAUTH2 PLAIN-CLIENTTOKEN 250-ENHANCEDSTATUSCODES 250-PIPELINING 250 CHUNKING 
Failed to authenticate password. Error: 535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8 http://support.google.com/mail/bin/answer.py?answer=14257 vk17sm38324619pab.5 - gsmtp 
from: 530-5.5.1 Authentication Required. Learn more at 530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 vk17sm38324619pab.5 - gsmtp 
The following SMTP error was encountered: 530-5.5.1 Authentication Required. Learn more at 530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 vk17sm38324619pab.5 - gsmtp 
to: 530-5.5.1 Authentication Required. Learn more at 530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 vk17sm38324619pab.5 - gsmtp 
The following SMTP error was encountered: 530-5.5.1 Authentication Required. Learn more at 530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 vk17sm38324619pab.5 - gsmtp 
to: 530-5.5.1 Authentication Required. Learn more at 530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 vk17sm38324619pab.5 - gsmtp 
The following SMTP error was encountered: 530-5.5.1 Authentication Required. Learn more at 530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 vk17sm38324619pab.5 - gsmtp 
to: 530-5.5.1 Authentication Required. Learn more at 530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 vk17sm38324619pab.5 - gsmtp 
The following SMTP error was encountered: 530-5.5.1 Authentication Required. Learn more at 530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 vk17sm38324619pab.5 - gsmtp 
to: 530-5.5.1 Authentication Required. Learn more at 530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 vk17sm38324619pab.5 - gsmtp 
The following SMTP error was encountered: 530-5.5.1 Authentication Required. Learn more at 530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 vk17sm38324619pab.5 - gsmtp 
to: 530-5.5.1 Authentication Required. Learn more at 530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 vk17sm38324619pab.5 - gsmtp 
The following SMTP error was encountered: 530-5.5.1 Authentication Required. Learn more at 530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 vk17sm38324619pab.5 - gsmtp 
to: 530-5.5.1 Authentication Required. Learn more at 530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 vk17sm38324619pab.5 - gsmtp 
The following SMTP error was encountered: 530-5.5.1 Authentication Required. Learn more at 530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 vk17sm38324619pab.5 - gsmtp 
to: 554 5.7.0 Too Many Unauthenticated commands. vk17sm38324619pab.5 - gsmtp 
The following SMTP error was encountered: 554 5.7.0 Too Many Unauthenticated commands. vk17sm38324619pab.5 - gsmtp 






두가지 방법으로 해봤는데 다 에러라 ㅠㅠ 

//원래한 방법은 이렇게 했습니다. Case1
$email_config['mailtype']      = "html";
$email_config['charset']       = "UTF-8";
$email_config['protocol']      = "smtp";
$email_config['smtp_host']     = "ssl://smtp.googlemail.com";
$email_config['smtp_port']     = 465;
$email_config['smtp_user']     = "noreply@gmail.com";
$email_config['smtp_pass']     = "testpwd";
$email_config['smtp_timeout']  = 10;
$email_config['wordwrap']      = TRUE;

// 해당 이메일로 확인 메일을 송신
$this->load->library('email', $email_config);
$this->email->set_newline("\r\n");
$this->email->clear();
$this->email->from(DEF_MAIL_FROM, DEF_MAIL_FROM_NAME);
$this->email->to( $receive_email );
$this->email->subject( 'purchased information' );
$this->email->message( $htmlMessage );
$this->email->set_alt_message( $txtMessage );

if ( strlen($receive_email) > 0 )
{
  if (!$this->email->send())
  {
     //fail, 메일테이블에 로그 기록
  }
  else
  {
     //success, 메일테이블에 로그 기록
  }
}

//Case2. 1이나 이거나 별차이없습니다만..T_T
$email_config = array(
  'mailtype'  => 'html',
  'charset'   => 'UTF-8',
  'protocol'  => 'smtp',
  'smtp_host' => 'ssl://smtp.googlemail.com',
  'smtp_port' => 465,
  'smtp_user' => 'noreply@gmail.com',
  'smtp_pass' => 'testpwd',
  'wordwrap'  => true,
  'smtp_timeout' => 10
);

// 해당 이메일로 확인 메일을 송신
$this->load->library('email', $email_config);
$this->email->set_newline("\r\n");
$this->email->clear();
$this->email->from(DEF_MAIL_FROM, DEF_MAIL_FROM_NAME);
$this->email->to( $receive_email );
$this->email->subject( 'purchased information' );
$this->email->message( $htmlMessage );
$this->email->set_alt_message( $txtMessage );

if ( strlen($receive_email) > 0 )
{
  if (!$this->email->send())
  {
     //fail, 메일테이블에 로그 기록
  }
  else
  {
     //success, 메일테이블에 로그 기록
  }
}

여러분의 지혜를 빌려주세요 ㅠㅠㅠㅠㅠ 
 다음글 디비 연결 타임아웃 설정 (3)
 이전글 포럼 소스를 다시 다운받아 설치해보니 message 라... (2)

댓글

변종원(웅파) / 2013/11/21 10:35:57 / 추천 0
기본적인 것부터 체크하자면

포트 열려있나 체크부터.. ^^