Re: need help with using Mail.php
| From: | Justin Patrin | Date: | Thu, 19 Oct 2006 17:44:30 +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-25558@lists.php.net to get a copy of this message | ||
On 10/19/06, Paula Fether <gridzmaster@gmail.com> wrote:
---------- Forwarded message ---------- From: Paula Fether <gridzmaster@gmail.com> Date: Oct 19, 2006 8:15 AM Subject: Re: [PEAR] need help with using Mail.php To: papercrane@reversefold.com pear info PEAR gives: About PEAR-1.3.6 ================Yep, so upgrade that package first: pear upgrade Archive_Tar pear upgrade PEARProvides Classes: OS_Guess, System Package PEAR Summary PEAR Base System Description The PEAR package contains: * the PEAR installer, for creating, distributing and installing packages * the alpha-quality PEAR_Exception php5-only exception class * the beta-quality PEAR_ErrorStack advanced error handling mechanism * the PEAR_Error error handling mechanism * the OS_Guess class for retrieving info about the OS where PHP is running on * the System class for quick handling common operations with files and directories * the PEAR base class Maintainers Stig Bakken < stig@php.net> (lead) Tomas V.V.Cox <cox@idecnet.com> (lead) Greg Beaver <cellog@php.net> (lead) Pierre-Alain Joye <pajoye@pearfr.org> (lead) Martin Jansen <mj@php.net> (developer) Version 1.3.6 Release Date 2005-08-18Release State stable Release License PHP License Release Notes * Bump XML_RPC dependency to 1.4.0* return by reference from PEAR::raiseError() Release Deps PHP >= 4.2 Package Archive_Tar >= 1.1 Package Console_Getopt >= 1.2 Package XML_RPC >= 1.4.0 ext xml == ext pcre == ext xmlrpc ==Last Modified 2006-03-05 And pear upgrade PEAR gives downloading PEAR-1.4.11.tgz ... Starting to download PEAR-1.4.11.tgz (283,272 bytes) ..........................................................done: 283,272 bytes requires package `Archive_Tar' >= 1.3.1 PEAR: Dependencies failed
On 10/19/06, Justin Patrin <papercrane@gmail.com > wrote: On 10/18/06, Paula Fether <gridzmaster@gmail.com > wrote:/usr/lib/php/extensions/no-debug-non-zts-20020429downloading PEAR-1.4.11.tgz ... Starting to download PEAR-1.4.11.tgz (283,272 bytes) ..........................................................done: 283,272 bytes Release for 'pear' dependency Release for 'pear' Release for 'pear' dependencyhas'PEAR_Frontend_Web' has state dependency 'PEAR_Frontend_Gtk2'state'stable''alpha', requires 'stable' 'PEAR_Frontend_Gtk' 'beta', requiresThat output doesn't make sense to me.... could you do: pear info PEAR Then try: pear upgrade PEARhas state 'beta', requires 'stable'upgrade failedOn 10/18/06, Justin Patrin <papercrane@gmail.com> wrote:Mail,On 10/18/06, Paula Fether <gridzmaster@gmail.com > wrote:Yes, I did that twice.Ok, well, if upgrading PEAR didn't work or it did work but the installer still says there are no package.xml 2.0 handlers then somehting is wrong. What happens when you do: pear upgrade -a PEAROn 10/18/06, Justin Patrin < papercrane@gmail.com > wrote:On 10/18/06, Paula Fether <gridzmaster@gmail.com> wrote:package.xmlI tried the install again and saw the message "No handlers forversion 2.0" but I don't think that has anything to do withdoesyourit?The first lines of the install are Starting to download Mail-1.1.14.tgz (17,537 bytes) ......done: 17,537 bytes downloading Net_SMTP-1.2.8.tgz ... So maybe it's downloaded but not installed?Did you do the upgrade-all as I asked before? You need to updatetestPEAR package.On 10/18/06, Justin Patrin < papercrane@gmail.com > wrote:On 10/18/06, Paula Fether <gridzmaster@gmail.com> wrote:pearcmd.phpListing of /usr/lib/php isArchive Net PEAR.php buildConsole OS System.php datadocHTML PEAR XMLso apparently Mail.php wasn't installed.Sounds like pear install -a Mail sisn't work....On 10/18/06, Justin Patrin < papercrane@gmail.com> wrote:On 10/18/06, Paula Fether < gridzmaster@gmail.com > wrote:rememberedDone, also added some more paths. No change. Eventomessage,restartApache again. The new paths do show up in the errorsowrote:thechangesare taking effect, but it still can't find Mail.phpDid you look to see if Mail.php is actually there? Did you ge it installed via the pear command?On 10/18/06, Justin Patrin < papercrane@gmail.com>wrote:On 10/18/06, Paula Fether < gridzmaster@gmail.com >stored,/private/etc/php.iniThat's weird. Phpinfo now shows the php.ini path as.There must be another place where the path isI'mnowrote: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>Saved file as php.ini, restarted Apache, stillworky.gridzmaster@gmail.comphpinfo();You still get the file not found problem? Runinclude_pathagain(onyour webserver) and look at the php.ini andvalues.Arethey what you expect?On 10/18/06, Justin Patrin < papercrane@gmail.comwrote:On 10/18/06, Paula Fether </usr/lib/phpwrote:pear config-show says php_dir isUnixphpinfo() says php.ini.default is in /etc found php.ini.default and un-commented thecan'tinclude_path,thenadded/usr/lib/php saved php.ini.default but my program stillfindMail.phpSo I'm guessing I didn't add the path in therightsays.place, orIneedtosavethe file as php.ini?It needs to be named exactly as phpinfo()Theit to.defaultversionjust has the defaults in it. You should copyopenpapercrane@gmail.com >php.iniandchangeit there. Then you need to restart apache.On 10/18/06, Justin Patrin <gridzmaster@gmail.com>wrote:On 10/18/06, Paula Fether <wrote:Done, but it can't find Mail.php: Warning: main( Mail.php): failed toaddrequired 'stream: No/Users/paulafether/Sites/gui4me.com/Temail.phpsuchfileordirectoryinonline 2Fatal error: main(): Failed opening/Users/paulafether/Sites/gui4me.com/Temail.phpMail.php'(include_path='.:/usr/lib/php') inonline2Do: pear config-show and look for the php_dir line. You need torightcomesthatphp.ini,pathtoyourinclude_path in your php.ini. To find yourputthisin ascript (at the top) and look for php.ini: phpinfo();Doing "which Mail.php " in Terminal alsothatupempty."which" is for finding binary commands, sowon'tworkforthesekind of files. You can try using: locate Mail.php but the locate database isn't updatedawaybin_dirandpapercrane@gmail.com >maynotfindituntil updatedb is re-run.On 10/18/06, Justin Patrin <gridzmaster@gmail.comwrote:On 10/18/06, Paula Fether <wrote:Net_SMTP- 1.2.8.tgz,It downloaded Mail-1.1.14.tgz andthensaidFirst 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 directorydoc_dir/usr/binPEAR documentation directory/usr/lib/php/docPHP extensiondirectory ext_dir
php_dirPEAR directory
cache_dir/usr/lib/phpPEAR Installer cache directory
/tmp/pear/cachePEAR data
directory data_dir/usr/lib/php/data
php_binPHP CLI/CGI binary
/usr/bin/phpPEAR test
directory test_dir/usr/lib/php/test
cache_ttlCache TimeToLive
preferred_state3600Preferred Package State22stableUnix file mask umaskDebug Log
Level verbose1
http_proxyHTTP Proxy Server Address
passwordmaster_server<notset>PEAR serverpear.php.netPEAR password (for
sig_bin<notset>maintainers) Signature Handling Program
sig_keyidsig_keydir/usr/local/bin/gpgSignature Key Directory/private/etc/pearkeysSignature Key Id
sig_type<notset>Package Signature Type
usernamegpgPEAR username (for
with----------<notpapercrane@gmail.com >set>maintainers) On 10/18/06, Justin Patrin <gridzmaster@gmail.com>wrote:On 10/18/06, Paula Fether <wrote:---------- Forwarded messagegridzmaster@gmail.com >From: Paula Fether <Date: Oct 18, 2006 12:06 PM Subject: Re: [PEAR] need help
usinginstallation,response.Mail.phpTo: papercrane@reversefold.com Hi Justin, thanks for the quickPEAR came with my php
so Iandthat itthoughteverythingwasalreadyhere. That's why I was surpriseddirectorycouldn'tfindMail.php.SoIjustdownloaded it and put it in thewithmysite.So Iguess Ineed todownload the whole PEAR package
dowhenconcerninganinstallthen?Ifso,arethereanyprecautions I need to takeotherprogramsthatuseit?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
methodscallingMail,butitdoesn'tseemtoget there.Did you try the error handling
onmysqldumppaths,mywiki?Thanks again for your help.! PS: I've had other problems withmaybethisisanotherone. Ihadtomanually add the path to
inorderTerminal(macosx),andthenappendthe PATH statement in php in
to dosimpleyourmysqldumpfromthere.It's possible that 'pear' isn't indifferent.path.Trytheaboveandsee ifit is. include_path in PHP ispapercrane@gmail.com >On 10/18/06, Justin Patrin <gridzmaster@gmail.comwrote:On 10/18/06, Paula Fether <wrote:Hi, I'm trying to send
emailswebhostsomeonefrom awebsite.Iusedtojustuse"mail()" but noticed that ifreadstheheaderstheycanseeinformation about the
thattheI'drathernotsend,so ItriedMail.php.At first it couldn't find
program soIdownloadedit.Then Iwrotethefollowing test code: <?php require_once " Mail.php
"; //use
me@mail.comPEARyou@mail.com";$recipients = "$headers["From"] = "
"test";you@mail.com$headers["To"] = "";$headers["Subject"] =
withmoreremotehost";$body = "just testing some
(PEAR::isError($mail_object))now";mail.me.com";$params["host"] = ""mypassword";owner@me.com ";$params["port"] = "25"; $params["auth"] = true; $params["username"] = "$params["password"] =&Mail::factory("smtp",$mail_object =Mail::send($recipients,$params);$mail_object =$headers,$body);if
{"*Fatalsuccessfully$mail_object->getMessage()echo("<p>" .."</p>");}else{ echo("<p>Messagesent!</p>");}?> But it gives the error
PEAR*/mypath.com/Mail.php*error*:Callto amemberfunctiononanon-object in"functiononline*90*".That's where Mail callssend($recipients,$headers,$body)".Help please?A few things: 1) Did you install via the
PEARinstallerorbymanuallycopyingthefile? You shoul dbe using the
Theinstaller.2) Did you install Net_SMTP?
smtpbeforebackendtorequiresthispackage as well. 3) Are you checking for errorserror tousinyourobject?Likelytheabove problems are causing anhttp://pear.reversefold.com/dokuwiki/doku.php?id=phpfaqs#what_does_call_to_undefined_method_xxxxxx_meanbereturned.See:
-- Justin Patrin -- Justin Patrin-- Justin Patrin-- Justin Patrin-- Justin Patrin-- Justin Patrin-- Justin Patrin-- Justin Patrin-- Justin Patrin-- Justin Patrin-- Justin Patrin-- Justin Patrin-- Justin Patrin