Call To Undefined Method Pear Error Send
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads unable to find class for driver smtp with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the call to undefined method pear error Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: unable to find class for driver mail Sign up pear mail error up vote 2 down vote favorite 1 Ok. I have used the apparently working code(the main top answer with 136 green ticks): Send email using GMail SMTP server from PHP page in my php mail script, replacing
Mail::factory
the gmail user and pass with my own... at first I got errors that PEAR, then PEAR5 could not be found... so I copied those 2 files(I downloaded from pear site) into the script's folder... Still, script didn't work. I added some echoes to see where it halts, and it halts at this line(I think): $mail = $smtp->send($to, $headers, $body); My apache/php error log says this: PHP Fatal error: Call to undefined method PEAR_Error::send()` I have googled this error and found over a dozen pages but havn't found an anwser... mostly they seem to say something about "installing pear libraries." I have not tried installing/configuring pear on my local server.... because I do not think I can install new packages on my webhost, so I need a more portable solution: What I mean by this is a working script, and any relative class files I can just copy all into one folder to get it working..... so I can just copy this folder to any apache/php server and it will automatically work(by refrencing the script in html form), without having to install/configure some third party package on the server. I also tried phpmailer which gave similar problems and it seems to also require pear so I don't really see the point of experimenting with phpmailer further if I cannot get pear to even work. php email smtp pear share|improve this question edited Mar 10 '14 at 21:42 Arian Faurtosh 6,03185080 asked Mar 13 '13 at 23:26 droidtech 3015 add a comment| 3 Answers 3 active oldest votes up vote 0 down vote accepted PHP Fatal error: Call to undefined method PEAR_Error::send() This means you didn't get a mail object but an error object, probably because logging in failed or so. Add the following to your code: $mail = Mail::factory(..); if (PEAR::isError($mail)) { echo $mail->getMessage() . "\n" . $mail->getUserInfo() . "\n"; die(); } $mail->send(...); Btw, using $searchengine to look for that error message would have given you the same answer. sha
Mark Forums Read Quick Links Today's Posts View Site Leaders Who's Online Advanced Search Forum FormMail Support Bug Reports PEAR Send error Our Forums are now READ ONLY. We are no longer accepting registrations and you can no longer post or reply to posts. For over a decade the forums have served our user community well, but in recent times there are no knowledgeable users providing answers in our Community http://stackoverflow.com/questions/15398459/pear-mail-error Support forums. In addition, we're constantly having to ban spammers and remove their posts. You're still welcome to contact us for support: http://www.tectite.com/contacts.php. We offer support via a fee-based service. Results 1 to 2 of 2 Thread: PEAR Send error Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to https://www.tectite.com/vbforums/showthread.php?3498-PEAR-Send-error Hybrid Mode Switch to Threaded Mode 07-Jan-2009,05:43 PM #1 ruffneck2 View Profile View Forum Posts Active Member Join Date Jan 2009 Posts 1 PEAR Send error Ive been using tectite forms for awhile now and worked just dandy, but now i need to log into my smtp server so i had to switch to PEAR. but now i just get this error any help or point me in the right direction would be great Code: PHP Fatal error: Call to undefined method PEAR_Error::send() in C:\Inetpub\wwwroot\removed\removed\formmail.php on line 4510 this is line 4510 Code: } if (!isset($a_headers['To']) && !isset($a_headers['to'])) $a_headers['To'] = $s_to; if (!isset($a_headers['Subject']) && !isset($a_headers['subject'])) $a_headers['Subject'] = $s_subject; --> $res = $mailer->send($s_to,$a_headers,$s_mesg); if ($res === TRUE) return (TRUE); global $aAlertInfo; so im guessing its failing when it tries to send Thanks in advance Reply With Quote 07-Jan-2009,09:41 PM #2 russellr View Profile View Forum Posts Visit Homepage Tectite and FormMail Author Join Date Dec 2003 Posts 3,979 Re: PEAR Send er
your first visit, be sure to check out the FAQ by clicking the link above. http://www.webdeveloper.com/forum/showthread.php?168169-sending-e-mail-via-php-issues You may have to register before you can post: click https://www.daniweb.com/programming/web-development/threads/379879/pear-mail-path-error the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 6 of 6 Thread: sending e-mail via php...issues Tweet Thread Tools Show Printable Version Email call to this Page… Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 12-10-2007,12:14 PM #1 pulleys View Profile View Forum Posts Registered User Join Date Apr 2006 Posts 15 sending e-mail via php...issues Hello, I need to send e-mail via php script. The mail server call to undefined requires smtp authentication. I am using the pear package to do this but I am having some problems. I receive this error when I try to execute the script: Call to undefined method PEAR_Error::send() Pear is installed on the server. How do I get this working? Any particular server settings I need to consider? Thanks for the help. PHP Code: require_once"Mail.php";
$from="myname
$to="yourname
$subject="Hi!";
$body="Hi,\n\nHowareyou?";
$host="mail.myhost.com";
$username="user";
$password="password"$title"; if (isset ($_POST['submit'])) { $name = $_POST['name']; $q1 = "1.)" . $_POST['q1']; $q2 = "2.)" . $_POST['q2']; $q3 = "3.)" . $_POST['q3']; $q4 = "4.)" . $_POST['q4']; $q5 = "5.)" . $_POST['q5']; $qp = "6.)" . $_POST['qp']; } if ($name == "") { die ("You forgot something, go back and check over your quiz."); } if ($q1 == "1.) ") { die ("You forgot something, go back and check over your quiz."); } if ($q2 == "2.) ") { die ("You forgot something, go back and check over your quiz."); } if ($q3 == "3.) ") { die ("You forgot something, go back and check over your quiz."); } if ($q4 == "4.) ") { die ("You forgot something, go back and check over your quiz."); } if ($q5 == "4.) ") { die ("You forgot something, go back and check over your quiz."); } { echo<<
$q1
$q2
$q3
$q4
$q5