Smtp phpMail不在godaddy中工作,也不在mail()中工作

Smtp phpMail不在godaddy中工作,也不在mail()中工作,smtp,phpmailer,sendmail,Smtp,Phpmailer,Sendmail,我在尝试从godaddy smtp发送邮件时遇到以下错误 我得到以下错误 警告:require_once(class.phpmailer.php)[function.require once]:无法打开流:第60行的文件名中没有这样的文件或目录 致命错误:require_once()[function.require]:无法打开所需的“class.phpmailer.php”(include_path='。:/usr/local/php5_3/lib/php') 您的PHP脚本似乎无法找到c

我在尝试从godaddy smtp发送邮件时遇到以下错误

我得到以下错误 警告:require_once(class.phpmailer.php)[function.require once]:无法打开流:第60行的文件名中没有这样的文件或目录

致命错误:require_once()[function.require]:无法打开所需的“class.phpmailer.php”(include_path='。:/usr/local/php5_3/lib/php')


您的PHP脚本似乎无法找到class.phpmailer.PHP文件

  • 尝试将class.phpmailer.php文件复制到与php脚本相同的目录中

  • 在require_中指定class.phpmailer.php的完整路径一次
如果您碰巧没有class.phpmailer.php文件

  • 首先从PHPMailer网站下载
  • 将其复制到脚本可访问的位置
  • 在require_中指定其路径一次
  • <?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 = "test@mydomain.com" ; // this is email on godaddy account
    $mail->Password = "password";
    
    $mail->From = "test@mydomain.com" ;
    $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;
    }
    
    
      }
    
    ?>