웹마스터 팁

서버를 PHP5.6으로 교체했는데 메일이 작동안하더군요..

smtp connect() failed라는 에러가 뜰때 대처방법을 기록차원으로 남겨둡니다.

 

우선 phpmailer를 최신버전으로 받습니다. ( https://github.com/PHPMailer/PHPMailer )

 

class.smtp.php를 smtp.php로 class.phpmailer.php를 phpmailer.php로 바꾸고

./libs/phpmailer에 smtp.php와 phpmailer.php에 덮어쓰기 해줍니다. (만일을 대비해 백업해주세요)

 

phpmailer.php에서 클래스 시작전에 require_once 'smtp.php';를 입력해주세요.

 

require_once 'smtp.php';

class PHPMailer
{
    /**
     * The PHPMailer Version number.

 

1285번째줄 근처에 smtpConnect 함수 시작부분에

$options = array_merge(array('ssl' => array('verify_peer' => false, 'verify_peer_name' => false)),$options);

를 입력해주세요.

 

public function smtpConnect($options = array())
{
$options = array_merge(array('ssl' => array('verify_peer' => false, 'verify_peer_name' => false)),$options);

if (is_null($this->smtp)) {

 

./classes/mail/mail.class.php를 열어 152번째줄 useGmailAccount 함수에서

$this->SMTPSecure = "ssl";

$this->Port = '465';

수정해줍시다.

 

function useGmailAccount($account_name, $account_passwd)
{
$this->SMTPAuth = TRUE;
$this->SMTPSecure = "ssl";
$this->Host = 'smtp.gmail.com';
$this->Port = '465';

 

 

openSSL에 문제가 있어 작동하지 않은듯 합니다..

 

인증메일을 보내려면 ./classes/mail/mail.class.php 140번째줄 Mail() 함수에

$this->useGmailAccount("아이디", "이메일"); 를 추가해주셔야합니다.

 

function Mail()
{
$this->useGmailAccount("아이디", "암호");
}

 

 

수정파일 올려둡니다. mail.zip

제목 글쓴이 날짜
SMTP 인증 회원가입 메일 인증 , 비밀번호 오류찾기 및 답변글 메일로 받기 [11] file FFHosting 2009.01.12
특정 도메인의 메일 주소로만 가입 인증 메일 보내기 [3] 박정욱 2009.03.28
인증메일 때문에 고생하시는 분 참고하세요. [17] 박용식 2010.10.14
성인인증 받는 소스입니다..... [17] q333 2003.01.12
PHP 인증 페이지를 만들자! - Lesson 1 수정본 #2 ☺[폐]허접-_- 2002.01.24
PHP 인증 페이지를 만들자! - Lesson 2 수정본 #1 [5] ☺[폐]허접-_- 2002.01.24
PHP 인증 페이지를 만들자! - Lesson 3 수정본 #1 [3] ☺[폐]허접-_- 2002.01.24
파일시스템에서 비밀번호 생성/수정/인증 [7] 두기두바 2002.01.10
웹 인증 보호, 윈도우 로그인 폼 이용 (authenticate) [9] file 둘리나라™ 2003.01.13
NZEO 이메일 인증 따라하기 [또 수정 --;] [44] file teslaMINT 2003.02.22
메일 인증시 기존 회원 전부 인증걸기;;; [4] teslaMINT 2003.03.04
홈페이지 관리자 모드 구축하기 (HTTP 인증, 중복 맞음) [10] file 9000㎒ 2003.11.01
PHP프로그램에 간단한 인증(로그인) 걸기. [15] Lepas 2004.08.09
[타키의 초보강좌]PHP 기초 강좌 제 1탄[패스워드 인증] [8] 타키 2004.10.23
htaccess를 활용하자 3탄! 사용자인증 [4] [쿨럭]블루엔젤 2003.01.23
qmail-1.03설치② (checkpassword 인증모듈) 비츠로 2003.02.28
qmail-1.03설치④ (vpopmail 인증모듈) 비츠로 2003.02.28
트래픽관리 Throttle-status 사용자 인증시키기 [1] Cksoft 2003.03.18
php 와 mysql 을 이용한 웹인증..(윈도우에서) 이성헌 2003.06.05
apache 서버에서 apache 인증 (윈도우에서 apm 설치후) 이성헌 2003.06.05