Loading ...
Sorry, an error occurred while loading the content.

SMTP Error: Could not authenticate

Expand Messages
  • Mehedi Hasan Sumon
    Dear All I am trying to use php mailer class : require_once( class.phpmailer.php ); $mail = new PHPMailer(); $mail- IsSMTP(); $mail- Host =
    Message 1 of 1 , Oct 14, 2009
    • 0 Attachment
      Dear All
      I am trying to use php mailer class :

      <code>
      require_once("class.phpmailer.php");
      $mail = new PHPMailer();
      $mail->IsSMTP();
      $mail->Host = "172.16.1.6";

         $mail->Host = "172.16.1.6";
          $mail->SMTPAuth = true;
          $mail->Username = "enquiry";
          $mail->Password = "enquiry";
         
          $mail->From = "enquiry@...";
          $mail->FromName = "test";
          $mail->AddAddress("mehedi@...");
      $mail->Subject = " Enquiry  ";
          $mail->IsHTML(false);
          $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!';
          $mail->MsgHTML("Test Body");
         
          $result = $mail->Send();
       
      if ($result) {
              header('Location: contact_message.php');
          } else {
              echo 'Error: ';
              echo $mail->ErrorInfo;
          }

      </code>

      But it always coming up with

      SMTP Error: Could not authenticate

      how can I solve it ? Please help. thanks

      Mehedi Hasan Sumon
      Software Development Engineer
      Kasatria MSC Sdn Bhd
      Unit 7.07, 1Tech Park,
      Tanjung Bandar Utama
      47800, Petaling Jaya
      Selangor, Malaysia



    Your message has been successfully submitted and would be delivered to recipients shortly.