Fatal error: Class 'Mail' not found

Discussion in 'PHP' started by matchesme, Aug 10, 2009.

  1. #1
    I have, what I believe to be, a simple question. I have created a file called sendmail.php which only contains the following include statement:

    <?php
    include('C:\HSphere.NET\3rdparty\PHP\5.2.5\PEAR\Mail\Mail.php');
    ?>

    This directory was given to me by my hosting company. When I browse to this file (http://.........sendmail.php) then it should not give me the following error
    Fatal error: Class 'Mail' not found in C:\HSphere.NET\3rdparty\PHP\5.2.5\PEAR\Mail\mail.php on line 26

    Am I correct?

    I'm just trying to prove to my hosting provider that their setup is wrong. Thanks for any guidance you can provide.
     
    matchesme, Aug 10, 2009 IP
  2. astrazone

    astrazone Member

    Messages:
    358
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    33
    #2
    can you see the directory? with the file your trying to access inside?
     
    astrazone, Aug 10, 2009 IP
  3. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #3
    if u can post the code of mail.php we can know .
     
    Bohra, Aug 11, 2009 IP
  4. pubdomainshost.com

    pubdomainshost.com Peon

    Messages:
    1,277
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Your directory name is not resolving thus the error. What you need to ensure is that server has access to the file that needs to be included.
    I am surprise by the Directory structure - apparently a windows hosting, but typically the files are stored in IIS / apache root not on C Drive

    Need more inputs mate.
     
    pubdomainshost.com, Aug 11, 2009 IP
  5. matchesme

    matchesme Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I cannot see the file astrazone. that's a good thought. I should be able to. Mail.php is not a file that I wrote, it is just a file I am attempting to access. Thanks for the extra comments pubdomainshosts. I've contacted my host provider with these questions. It makes logical sense that IIS / apache should have access to this file...and I need to know where they (iis/apache) can find them. It is a windows installation I'm pretty sure.

    thank you for the thoughts. I've sent my hosting provider these questions/thoughts. .
     
    matchesme, Aug 11, 2009 IP
  6. kblessinggr

    kblessinggr Peon

    Messages:
    539
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Try this

    
    mail('youremail@yourdomain.com', 'subject', 'test message'); 
    
    Code (markup):
    If that works without error and you end up sending an email to yourself, then you already got the sendmail module loaded in the php.ini.

    Also far as mail.php goes, if its on a site you own (ie: in the same account) you could access it via relative path instead of direct path like you're trying to do. To see where your home folder truely lies, create a php.php file, inside of that have <? phpinfo(); ?> goto that page then scroll down to find the document root, that'll tell you your actual logical path.
     
    kblessinggr, Aug 12, 2009 IP
  7. kblessinggr

    kblessinggr Peon

    Messages:
    539
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Also a note on the use of include(), file_get_contents() etc etc. IF the php file is not on the same account as the php script you are trying to access it from, then you won't receive the content of the php file, only the generated content (such as when a browser goes to it) which in your case could be blank.

    If one account could see the content of another account's php file, that would be a serious security risk.
     
    kblessinggr, Aug 12, 2009 IP