개발 Q&A

제목 email관련 질문드립니다.
글쓴이 작성시각 2012/11/22 15:35:24
댓글 : 3 추천 : 0 스크랩 : 0 조회수 : 17841   RSS
안녕하세요 .
자주 질문드려서 죄송합니다.

jsp나 ,안드로이드에서 gmail의smtp 서버를 이용하여 메일을 잘 전송하고 있습니다.

그런데 php에서 문제가 좀..
아무래도 세팅 문제같은데요 

컨트롤러에서 ci 메뉴얼처럼 작성하였습니다.
$config['protocol']  = 'smtp';
$config['mailpath']  = '/usr/sbin/sendmail';
$config['charset']   = 'utf-8';
$config['wordwrap']  = TRUE;
$config['smtp_host'] = 'smtp.gmail.com';
$config['smtp_user'] = '유저아이디';
$config['smtp_pass'] = '유저비밀번호';
$config['smtp_port'] = '465';
$config['mailtype'] = 'text';
$config['smtp_timeout'] = 5;
위의 내용 대로 적용하고 
$this->email->send(); 하여 보내면

The following SMTP error was encountered: 
Failed to send AUTH LOGIN command. Error: 
from: 
The following SMTP error was encountered: 
to: 
The following SMTP error was encountered: 
data: 
The following SMTP error was encountered: 

The following SMTP error was encountered: 
Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.


이런 메시지를 보여주내요.

$config['smtp_host'] = 'ssl://smtp.googlemail.com'; 이걸로 수정하니

Message: fsockopen(): unable to connect to ssl://smtp.googlemail.com:465 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?)

Filename: libraries/Email.php

Line Number: 1689

요런게 떨어지내요 


아무래도 인증관련 같은데 ~ 메뉴얼에 보면 인증관련은 없던데 이부분 어떻게 하시나요?






 다음글 현재 시간을 받아오는 방법? (2)
 이전글 php 게시판 질문 드립니다. (5)

댓글

한대승(불의회상) / 2012/11/22 15:49:47 / 추천 0
     $config = array(
       'protocol' => 'smtp',
       'smtp_host' => 'ssl://smtp.googlemail.com',
       'smtp_port' => 465,
       'smtp_user' => 'gmailID',
       'smtp_pass' => 'gmail암호'
        
     );
     $this->load->library('email', $config);    
     $this->email->set_newline("\r\n");
이렇게 함 해보세요.
/ 2012/11/22 16:35:57 / 추천 0
 일단 오류는 나지 않는데요. 성공적으로 보내졌다는데 메일이 도착 안하내요 음 
지금 현재 개발 서버로 
윈도우에 xampp 설치하여  ci 공부중인데요 혹시 
여기에 따로 설정 할게 있나요 xampp에?
/ 2012/11/23 18:40:47 / 추천 0
 해결했습니다. 
문제는 방화벽과 ssl 설정
xampp 기본 세팅에서는 php.ini파일에 ssl 설정이 활성화가 안되어있으니
ssl 부분 앞;제거해주심되고
방화벽도 윈도우에서 인바운드 아웃바운드 설정하니 되내요