mercyfullmusic Posted May 4, 2006 Share Posted May 4, 2006 I am using PEAR Mail to send an email through a remote email server. When I run the following code the email goes through successfully, but I get the following error:********************************************************Email sent successfully!PHP Notice: Only variable references should be returned by reference in C:\php\PEAR\pear\Mail\mime.php on line 375 PHP Notice: Only variable references should be returned by reference in C:\php\PEAR\pear\Mail\mime.php on line 593 How do I fix this? (PS: I have really no experience with PEAR and am amazed I got this far)********************************************************Thanks in advance,Here's my code:<?php require "Mail.php";require "Mail/mime.php";$from = "Test Email<[email protected]>";$to="email1<[email protected]>";$cc="email2<[email protected]>";$subject="Sending e-mails from PEAR::Mail";$headers=array('From'=>$from,'To'=>$to,'Cc'=>$cc,'Subject'=>$subject);$host = "mail.somedomain.com";$username ="[email protected]";$password ="password";$smtp = Mail::factory('smtp',array('host'=>$host,'auth'=>true,'username'=>$username,'password'=>$password));$mime=new Mail_mime();$txtBody = <<< BODYHello,This is a test email sent from the PEAR::Mail Class.BODY;$mime->setTXTBody($txtBody);$htmlBody=<<< BODY<html><body><h1>Hello,</h1><br><br>This is a test email sent from the PEAR::Mail Class.<br></body></html>BODY;$mime->setHTMLBody($htmlBody);$body = $mime->get();$headers=$mime->headers($headers);$mail=$smtp->send($to,$headers,$body);// test file to send an email direct from the serverecho "Email sent successfully!";?> Link to comment https://forums.phpfreaks.com/topic/9086-problem-with-pear-mail-please-help/ Share on other sites More sharing options...
kanikilu Posted May 8, 2006 Share Posted May 8, 2006 This is a bug: [a href=\"http://pear.php.net/bugs/bug.php?id=5333\" target=\"_blank\"]http://pear.php.net/bugs/bug.php?id=5333[/a]That page says to try the latest version in CVS: [a href=\"http://cvs.php.net/viewcvs.cgi/pear/Mail_Mime/\" target=\"_blank\"]http://cvs.php.net/viewcvs.cgi/pear/Mail_Mime/[/a] Link to comment https://forums.phpfreaks.com/topic/9086-problem-with-pear-mail-please-help/#findComment-34318 Share on other sites More sharing options...
mercyfullmusic Posted May 8, 2006 Author Share Posted May 8, 2006 [!--quoteo(post=372302:date=May 8 2006, 07:48 AM:name=kanikilu)--][div class=\'quotetop\']QUOTE(kanikilu @ May 8 2006, 07:48 AM) [snapback]372302[/snapback][/div][div class=\'quotemain\'][!--quotec--]This is a bug: [a href=\"http://pear.php.net/bugs/bug.php?id=5333\" target=\"_blank\"]http://pear.php.net/bugs/bug.php?id=5333[/a]That page says to try the latest version in CVS: [a href=\"http://cvs.php.net/viewcvs.cgi/pear/Mail_Mime/\" target=\"_blank\"]http://cvs.php.net/viewcvs.cgi/pear/Mail_Mime/[/a][/quote][b]Issue Fixed !!!!!!!!! Thank You !!!!!!!!!!!!!!!!![/b] Link to comment https://forums.phpfreaks.com/topic/9086-problem-with-pear-mail-please-help/#findComment-34374 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.