게시판 즐겨찾기
편집
드래그 앤 드롭으로
즐겨찾기 아이콘 위치 수정이 가능합니다.
php mailer 오류 가 엉어엄ㄴㅇ러ㅣㅁㄴㅇ러ㅣㅁㄴ;ㅇㄹ
게시물ID : computer_137350짧은주소 복사하기
작성자 : 으뮤으뮤
추천 : 0
조회수 : 526회
댓글수 : 1개
등록시간 : 2013/12/23 16:57:29
<html>
<head> 
<title>PHPMailer - SMTP (Gmail) basic test</title> 
</head> 
<body> 
<?php
require 'Mailer/class.phpmailer.php';
$mail = new PHPMailer;
$mail->IsSMTP();                                      // Set mailer to use SMTP
$mail->host = 'stmp.gmail.com';  // smtp 주소 
$mail->Port=587;
$mail->SMTPAuth = true;                               // Enable SMTP authentication
$mail->Username = '[email protected]';                            // SMTP username 메일주소
$mail->Password = 'password';                           // SMTP password 메일 접속 시 비밀번호
$mail->SMTPSecure = 'ssl';                            // Enable encryption, 'ssl' also accepted 
  
$mail->From = '[email protected]';                  //보내는 사람 메일 주소
$mail->FromName = 'Mailer';                           //보내는 사람 이름
$mail->AddAddress('[email protected]');  // Add a recipient 받는 사람 주소, 받는 사람 이름
              // Name is optional    받는 사람 이메일 주소만

$mail->IsHTML(true);                                  // Set email format to HTML  메일을 보낼 때 html 형식으로 메일을 보낼 경우 true
  
$mail->Subject = 'Here is the subject';                //메일 주소
$mail->Body    = 'This is the HTML message body <B>in bold!</B>';  //메일 본문
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients'; // 메일 본문을 오로지 텍스트 형식으로만 보낼 때 
  
if(!$mail->Send()) 
{
   echo '보낼수 없음.';
   echo 'Mailer Error: ' . $mail->ErrorInfo;         // 메일 전송에 실패 했을 경우 뜨는 에러 메세지
   exit;
}
  
echo 'Message has been sent';
?>
</html>

소스는 이렇게 되는데

에러가 
Mailer Error: The following From address failed: @gmail.com : Called Mail() without being connected

라고 뜨네요.. 어디가 문제일까요......하루종일 이것만하네요...
꼬릿말 보기
전체 추천리스트 보기
새로운 댓글이 없습니다.
새로운 댓글 확인하기
글쓰기
◀뒤로가기
PC버전
맨위로▲
공지 운영 자료창고 청소년보호