Re: need help with using Mail.php
| From: | Justin Patrin | Date: | Wed, 18 Oct 2006 22:51:26 +0000 |
| Subject: | Re: need help with using Mail.php | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-25543@lists.php.net to get a copy of this message | ||
On 10/18/06, Paula Fether <gridzmaster@gmail.com> wrote:
That's weird. Phpinfo now shows the php.ini path as /private/etc/php.ini . There must be another place where the path is stored, I'm guessing.Try editing that file then.
On 10/18/06, Justin Patrin <papercrane@gmail.com> wrote: On 10/18/06, Paula Fether <gridzmaster@gmail.com> wrote:-- Justin PatrinSaved file as php.ini, restarted Apache, still no worky.You still get the file not found problem? Run phpinfo(); again (on your webserver) and look at the php.ini and include_path values. Are they what you expect?On 10/18/06, Justin Patrin <papercrane@gmail.com > wrote:addedOn 10/18/06, Paula Fether <gridzmaster@gmail.com > wrote:pear config-show says php_dir is /usr/lib/php phpinfo() says php.ini.default is in /etc found php.ini.default and un-commented the Unix include_path, thento/usr/lib/php saved php.ini.default but my program still can't find Mail.php So I'm guessing I didn't add the path in the right place, or I needsaveorthe file as php.ini?It needs to be named exactly as phpinfo() says. The .default version just has the defaults in it. You should copy it to php.ini and change it there. Then you need to restart apache.On 10/18/06, Justin Patrin < papercrane@gmail.com > wrote:On 10/18/06, Paula Fether < gridzmaster@gmail.com> wrote:Done, but it can't find Mail.php: Warning: main( Mail.php): failed to open stream: No such file/Users/paulafether/Sites/gui4me.com/Temail.phpdirectoryinononline 2Fatal error: main(): Failed opening required ' Mail.php' (include_path='.:/usr/lib/php') in /Users/paulafether/Sites/gui4me.com/Temail.phplinethese2Do: pear config-show and look for the php_dir line. You need to add that path to your include_path in your php.ini. To find your php.ini, put this in a script (at the top) and look for php.ini: phpinfo();Doing "which Mail.php " in Terminal also comes up empty."which" is for finding binary commands, so that won't work foritkind of files. You can try using: locate Mail.php but the locate database isn't updated right away and may not findsaiduntil updatedb is re-run.On 10/18/06, Justin Patrin <papercrane@gmail.com > wrote:On 10/18/06, Paula Fether < gridzmaster@gmail.com > wrote:It downloaded Mail-1.1.14.tgz and Net_SMTP-1.2.8.tgz, then/usr/lib/php/docFirst thing you should do is: pear list-upgrades then pear upgrade-all Once that's done, look again at: pear help install You want pear install -a Mail Net_SMTPrequires package `Net_Socket' requires package `Auth_SASL' Net_SMTP: Dependencies failed Here are the config settings:PEAR executables directory bin_dir /usr/binPEAR documentation directory doc_dir/tmp/pear/cache/usr/lib/php/extensions/no-debug-non-zts-20020429PHP extension directory ext_dirPEAR directory php_dir /usr/lib/phpPEAR Installer cache directory cache_dirmaster_server1/usr/lib/php/dataPEAR data directory data_dir/usr/lib/php/testPHP CLI/CGI binary php_bin /usr/bin/php PEAR test directory test_dirCache TimeToLive cache_ttl 3600 Preferred Package State preferred_state stable Unix file mask umask 22 Debug Log Level verbose<notHTTP Proxy Server Address http_proxyset>PEAR servereverything/usr/local/bin/gpgpear.php.netPEAR password (for password <not set>maintainers)Signature Handling Program sig_bin/private/etc/pearkeysSignature Key Directory sig_keydirSignature Key Id sig_keyid <not set> Package Signature Type sig_type gpg PEAR username (for username <not set>maintainers) On 10/18/06, Justin Patrin < papercrane@gmail.com> wrote:On 10/18/06, Paula Fether < gridzmaster@gmail.com> wrote:---------- Forwarded message ---------- From: Paula Fether < gridzmaster@gmail.com> Date: Oct 18, 2006 12:06 PM Subject: Re: [PEAR] need help with using Mail.php To: papercrane@reversefold.com Hi Justin, thanks for the quick response. PEAR came with my php installation, so I thoughtwasSo IMail.php.alreadyhere. That's why I was surprised that it couldn't findSoIjustdownloaded it and put it in the directory with my site.Ifguess Ineed todownload the whole PEAR package and do an install then?so,thatarethereanyprecautions I need to take concerning other programsuseitit?Open up a terminal and type: pear help Then use it to do things like: pear install Mail Net_SMTPAlso I do have an error routine when calling Mail, butosx),anotherdoesn'tseemtoget there.Did you try the error handling methods on my wiki?Thanks again for your help.! PS: I've had other problems with paths, maybe this isone. Ihadtomanually add the path to mysqldump in Terminal (macandabovethere.thenappendthe PATH statement in php in order to do mysqldump fromIt's possible that 'pear' isn't in your path. Try theandwrote:see ifit is. include_path in PHP is different.On 10/18/06, Justin Patrin <papercrane@gmail.com >wrote:On 10/18/06, Paula Fether < gridzmaster@gmail.com>IHi, I'm trying to send simple emails from a website.usedheaderstojustuse"mail()" but noticed that if someone reads thetheysend,canseeinformation about the webhost that I'd rather notso IdownloadedtriedMail.php.At first it couldn't find the program so Iit.$body);Then Iwrotethefollowing test code: <?phprequire_once " Mail.php"; // use PEAR$recipients = " you@mail.com"; $headers["From"] = " me@mail.com"; $headers["To"] = " you@mail.com"; $headers["Subject"] = "test with remote host";$body = "just testing some more now";$params["host"] = " mail.me.com"; $params["port"] = "25"; $params["auth"] = true; $params["username"] = " owner@me.com"; $params["password"] = "mypassword";$mail_object = &Mail::factory("smtp", $params); $mail_object = Mail::send($recipients, $headers,"</p>");if (PEAR::isError($mail_object)) {echo("<p>" . $mail_object->getMessage() .member}else{ echo("<p>Message successfully sent!</p>"); }?> But it gives the error "*Fatal error*: Call to amanuallyfunction$headers,onanon-object in */mypath.com/Mail.php* on line *90*". That's where Mail calls "function send($recipients,$body)".Help please?A few things: 1) Did you install via the PEAR installer or byobject?requirescopyingthefile? You shoul dbe using the PEAR installer. 2) Did you install Net_SMTP? The smtp backend to Mailthispackage as well. 3) Are you checking for errors before usin yourLikelySee:theabove problems are causing an error to be returned.http://pear.reversefold.com/dokuwiki/doku.php?id=phpfaqs#what_does_call_to_undefined_method_xxxxxx_mean-- Justin Patrin-- Justin Patrin-- Justin Patrin-- Justin Patrin-- Justin Patrin-- Justin Patrin