• PHP Help PHP Coding
  • [RESOLVED] Possibly stupid question about using PEAR Mail_Queue and PEAR in general.

Okay,

I've used the PEAR command to install Mail_Queue and all its dependencies but what happens now? The web is frustratingly vague or else I'm just not sure what I should be asking it.

In my PHP directory I have a PEAR directory and that has many folders including the MAIL one wherein the Mail_Queue classes are.

So are these somehow referenced automatically by PHP so that I can use those classes? Or do I have to copy the PHP files to where I've got my website's class files so I can Include them?

I feel like I'm missing the link here... 🙁

    TheoGB wrote:

    So are these somehow referenced automatically by PHP so that I can use those classes?

    No, you'd have to do something like:

    require_once "Mail/Queue.php";

    assuming that the main PEAR directory has been added to your include_path directive (which it should have been - otherwise you should add it yourself).

    Also, did you try the PEAR manual? http://pear.php.net/mail_queue The documentation has a set of example files that show how to use any given class...

      Yeah, what it doesn't state (which you've now explained) is that the PEAR stuff will be on the include_path directive. I didn't realise there was a central directive like that (or if I did, I forgot it because it's been a long time since I had to change much like that).

      So I couldn't see how the require_once bit would work unless I somehow put the Mail stuff in a relative path.

      Cheers for clearing that up. 🙂

        Write a Reply...