PEAR Mail Authentication Problems

From: Date: Thu, 02 Oct 2003 15:28:59 +0000
Subject: PEAR Mail Authentication Problems
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-8238@lists.php.net to get a copy of this message
Hello, I have tracked my troubles with using the PEAR Mail class to smtp authentication failing. Here is what I have: <?php require 'Mail.php'; $to = 'ckline@mymailserver.net'; $headers['From'] = 'website@mymailserver.net'; $headers['Subject'] = 'Testing'; $body = 'hey it worked'; $params['host'] = "smtp.mymailserver.net"; $params['auth'] = "TRUE"; $params['username'] = "ckline"; // have also tried ckline@smtp.mymailserver.net $params['password'] = "mypassword"; $message =& Mail::factory('smtp', $params); $result = $message->send($to, $headers, $body); echo "<pre>"; var_dump($result); echo "</pre>"; ?> The results of the var_dump() are this: object(pear_error)(8) { ["error_message_prefix"]=> string(0) "" ["mode"]=> int(1) ["level"]=> int(1024) ["code"]=> NULL ["message"]=> string(37) "unable to authenticate to smtp server" ["userinfo"]=> NULL ["backtrace"]=> array(2) {
    [0]=>
    array(6) {
      ["file"]=>
      string(32) "/usr/local/lib/php/Mail/smtp.php"
      ["line"]=>
      int(147)
      ["function"]=>
      string(10) "pear_error"
      ["class"]=>
      string(10) "pear_error"
      ["type"]=>
      string(2) "->"
      ["args"]=>
      array(1) {
        [0]=>
        string(37) "unable to authenticate to smtp server"
      }
    }
    [1]=>
    array(6) {
      ["file"]=>
      string(69) "/contact/send.php"
      ["line"]=>
      int(13)
      ["function"]=>
      string(4) "send"
      ["class"]=>
      string(9) "mail_smtp"
      ["type"]=>
      string(2) "->"
      ["args"]=>
      array(3) {
        [0]=>
        string(25) "ckline@smtp.mymailserver.net"
        [1]=>
        array(2) {
          ["From"]=>
          string(26) "website@smtp.mymailserver.net"
          ["Subject"]=>
          string(7) "Testing"
        }
        [2]=>
        string(13) "hey it worked"
      }
    }
} ["callback"]=> NULL }

« previous php.pear.general (#8238) next »