Hello

Im getting this php notice that says

PHP Notice: Only variables should be assigned by reference in /home/domain/backend/controls/control_email.php on line 32

Line 32, is this

$mail =& Mail::factory('mail');

why am i getting this error?

thanks.

    Is their anyway i can update this file from a bash promt?

    Im new to pear, so still trying to learn how to update packages.

      This did not resolve the problem.

        Just use

        $mail = Mail::factory('mail');

        the =& is not necessarily necessary. PEAR Mail will work without it.

        --FrosT

          2 years later

          Hi i got this from one of the forums...

          <?php
          require_once "Mail.php";

          $from = "Sender <sender@example.com>";
          $to = "Recipient <xxx@gmail.com>";
          $subject = "Hi!";
          $body = "Hi,\n\nHow are you?";

          $host = "smtp.xxx.com";
          $username = "xxx";
          $password = "xxx";

          $headers = array ('From' => $from,
          'To' => $to,
          'Subject' => $subject);
          $smtp = Mail::factory('smtp',
          array ('host' => $host,
          'auth' => true,
          'username' => $username,
          'password' => $password));

          $mail = $smtp->send($to, $headers, $body);

          if (PEAR::isError($mail)) {
          echo("<p>" . $mail->getMessage() . "</p>");
          } else {
          echo("<p>Message successfully sent!</p>");
          }
          ?>

          and got this errors:

          Warning: Mail_smtp::include_once(Net/SMTP.php) [function.Mail-smtp-include-once]: failed to open stream: No such file or directory in C:\php\PEAR\Mail\smtp.php on line 206

          Warning: Mail_smtp::include_once() [function.include]: Failed opening 'Net/SMTP.php' for inclusion (include_path='.;c:\php\includes;C:\php\PEAR') in C:\php\PEAR\Mail\smtp.php on line 206

          Fatal error: Class 'Net_SMTP' not found in C:\php\PEAR\Mail\smtp.php on line 210

          can anyone help pls?

          php newbie

            Write a Reply...