2013-09-21 3 views
0

godaddy smtp에서 메일을 보낼 때 다음 오류가 발생합니다. 내가 오류 다음 얻고있다godaddy에서 phpmailer가 작동하지 않거나 mail()에서 작동하지 않습니다.

는 경고 : require_once를 (class.phpmailer.php는) function.require-번] : 파일 이름에 해당 파일 또는 디렉터리를 줄에 60

치명적인 오류 : 스트림을 열지 못했습니다 : require_once를() function.require] 실패 개방 요구 'class.phpmailer.php'(의 include_path = './usr/지방/php5_3/LIB/PHP')

<?php 
if (isset($_POST['email'])) 
//if "email" is filled out, send email 
    { 
    //send email 

require_once("class.phpmailer.php"); 
$mail = new PHPMailer(); 
//$mail->IsSMTP(); 
$mail->SMTPDebug = 1; // 1 tells it to display SMTP errors and messages, 0 turns off all errors and messages, 2 prints messages only. 
$mail->SMTPAuth = true; 
$mail->SMTPSecure = "https"; 
$mail->Host = "smtpout.asia.secureserver.net"; 
$mail->Port = 25; 

$mail->Username = "[email protected]" ; // this is email on godaddy account 
$mail->Password = "password"; 

$mail->From = "[email protected]" ; 
$mail->FromName = "some name" ; 

$mail->AddAddress($_POST['email'], $name); 
//$mail->AddReplyTo(“Email Address HERE”, “Name HERE”); // Adds a “Reply-to” address. Un-comment this to use it. 
$mail->Subject = "site no. ".$_POST['site1']." ".$_POST['status']." for you " ; 
$mail->Body = " Hi, your site with no. ".$_POST['site1']." in phase ".$_POST['phase1']." has been ".$_POST['status'] ; 

if ($mail->Send() == true) { 
echo "The message has been sent"; 
} 
else { 
echo "The email message has NOT been sent for some reason. Please try again later"; 
echo "Mailer error: " . $mail->ErrorInfo; 
} 


    } 

?> 

답변

2

It seems the your PHP script is unable to locate the class.phpmailer.php file

  • 시도 class.phpmailer.php 파일을 PHP 스크립트와 동일한 디렉토리는

또는

  • 는 require_once를

If at all you don't happen to have the class.phpmailer.php file :

  1. 먼저 다운로드를에 class.phpmailer.php의 전체 경로를 지정합니다 PHPMailer 웹 사이트
  2. 스크립트로 액세스 할 수있는 위치에 복사하십시오.
  3. require_once에서 해당 경로를 지정하십시오.
관련 문제