| 제목 | php email 전송 에러 도와주세요.. | ||
|---|---|---|---|
| 글쓴이 | 뫄뫄잉뿌 | 작성시각 | 2016/04/04 10:55:34 |
|
|
|||
// 메일 환경 설정
$mail = new PHPMailer();
$mail->CharSet = "euc-kr";
$mail->Encoding = "base64";
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = "smtp.mailplug.co.kr"; // SMTP server
$mail->SMTPDebug = 2; // enables SMTP debug information (for testing)
//$mail->SMTPDebug = false;
// 1 = errors and messages
// 2 = messages only
$mail->SMTPSecure = "ssl";
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->Port = 465; // set the SMTP port for the GMAIL server
$mail->Username = "test@test.net"; // SMTP account username
$mail->Password = "test1234"; // SMTP account password :
$mail->SetFrom("test@test.net", "테스트");
$mail->Subject = "축하합니다.";
$name = $_POST["name"];
$regDate = $_POST["regDate"];
$category = $_POST["category"];
$email = $_POST["email"];
// 입점 확인 메일 발송
$toName = $name;
$toMail = $email;
$mail_content = "";
ob_start();
include_once ("$_SERVER[DOCUMENT_ROOT]/mail/test_welcome.html"); // 폼메일 불러오기
$mail_content = ob_get_contents();
ob_end_clean();
$mail->MsgHTML($mail_content);
$mail->AddAddress($toMail, $toName);
$mail_send1 = $mail_send2 = "ok";
$mail_error1 = $mail_error2 = '';
if(!$mail->Send()) {
$mail_send1 ="error";
$mail_error1 = $toMail ." 발송에러: " . $mail->ErrorInfo;
}
$address ="test@test.net";
$to_name = "테스트";
$mail->AddAddress($address, $to_name);
if(!$mail->Send()) {
$mail_send1 ="error";
$mail_error1 = $address ." 발송에러: " . $mail->ErrorInfo;
}
error는 다음과같습니다. SMTP -> ERROR: Failed to connect to server: Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? (41747392)The following From address failed: test@test.net : Called Mail() without being connected SMTP -> ERROR: Failed to connect to server: Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? (41747392)The following From address failed: mk@hellot.net : Called Mail() without being connected
테스트서버와 환경은 동일한데 테스트 서버는 발송이 되고 운영서버에서는 발송이안되요.. php.ini는 테스트 서버와 운영서버 둘다 extension이 없습니다. |
|||
| 다음글 | sublimetext IDE setting ( auto... (1) | ||
| 이전글 | 혹시 이런 개발 환경 어떻게 보시는지 자문 구해봅니다 ... (5) | ||
|
한대승(불의회상)
/
2016/04/04 12:07:22 /
추천
0
|
|
뫄뫄잉뿌
/
2016/04/04 12:13:00 /
추천
0
테스트서버랑 운영서버 둘다 openssl extention 설치가 안되어있는데 테스트서버는 되고 운영서버는 안되요..ㅠㅠ왤까요
|
|
뫄뫄잉뿌
/
2016/04/04 12:39:18 /
추천
0
테스트서버, 운영서버 아파치에 둘다 OpenSSL 1.0.1e-filps 깔려있습니다..
|
|
변종원(웅파)
/
2016/04/04 13:58:00 /
추천
0
포트 열려있는지도 체크해보세요.
|
|
뫄뫄잉뿌
/
2016/04/04 15:09:48 /
추천
0
openssl s_client -connect 아이피:SSL포트번호 -state -debug 이걸로 포트 열려있나 확인해봤는데 테스트서버랑 운영서버 둘다 socket : connection refused connect : errno=111이 나옵니다.
|
|
뫄뫄잉뿌
/
2016/04/04 16:18:11 /
추천
0
telnet smtp.mailplug.co.kr 465 입력 결과 테스트서버는 trying ~ ... connected to smtp.mailplug.co.kr 이 나옵니다 ㅠㅠ 뭐가문제일까요..
|
ssl 접속에러가 나는것 같군요.
openssl extention 설치 되어 있는지 확인해 보세요.