Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2002

    phpBB sends out mail, but standard mail and smtp auth php scripts won't - help!

    i've been racking my brain all day long on this. The server that a client is running has a website along with phpBB on it. phpBB happily hums along and sends out emails whenever it is supposed to. However, the simplest of php mail() and smtp auth forms do not! Here is the outcome of each:

    PHP Code:
    mail([email protected]''subject''testing''-f [email protected]'); 
    == yields nothing

    PHP Code:
    require_once "Mail.php";
    $from "Web Master <[email protected]>";
    $to "Nobody <[email protected]>";
    $subject "Test email using PHP SMTP\r\n\r\n";
    $body "This is a test email message";
    $host "";
    $username "[email protected]";
    $password "yourPassword";
    $headers = array ('From' => $from,
    'To' => $to,
    'Subject' => $subject);
    $smtp Mail::factory('smtp',
      array (
    'host' => $host,
    'auth' => true,
    'username' => $username,
    'password' => $password));
    $mail $smtp->send($to$headers$body);
    if (
    PEAR::isError($mail)) {
    "<p>" $mail->getMessage() . "</p>");
    } else {
    "<p>Message successfully sent!</p>");
    == this gives the following error ... as well as no email.

    Warning: require_once(Mail.php) [function.require-once]: failed to open stream: No such file or directory in /var/www/nl/mailtest4.php on line 2

    Fatal error: require_once() [function.require]: Failed opening required 'Mail.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/nl/mailtest4.php on line 2

    any help would be GREATLY appreciated.

  2. #2
    Join Date
    Oct 2012
    Europe and USA
    This is the issue:

    require_once "Mail.php";
    We have come across this several times.

    Do you have root acess to the server?

    Run as root the following commands via SSH:

    pear install Mail
    pear install Mail_MIME
    pear install Net_SMTP
    service httpd restart
    This will install the Mail.php PHP pear class to the server-wide PHP includes directory (/usr/lib/php) and your script should be working properly.
    Last edited by NetworkPanda; 12-09-2013 at 10:06 PM.
    Network Panda :: Web Hosting SSD Powered :: Reseller Hosting
    Instant activation, fast servers, SSD disks, cPanel, Softaculous 1-click apps installer, daily backups, SSL certificates
    Multiple hosting locations: USA, Canada, France, UK, Germany, Italy, Spain, Poland, Finland

Similar Threads

  1. Replies: 2
    Last Post: 09-05-2013, 07:29 PM
  2. Direct Admin: Php mail() only sends email to certain domains (e.g. @yahoo)
    By martinsch in forum Hosting Security and Technology
    Replies: 4
    Last Post: 06-08-2009, 08:58 AM
  3. Emailing through SMTP, not PHP mail()
    By EEssam in forum Hosting Security and Technology
    Replies: 1
    Last Post: 04-04-2009, 07:14 PM
  4. [DirectAdmin] Mail to Hotmail only sends with php, not with any webmail
    By keyDet in forum Hosting Software and Control Panels
    Replies: 8
    Last Post: 01-30-2008, 05:27 PM
  5. php sends nobody as mail originator with sendmail
    By kevinm2 in forum Programming Discussion
    Replies: 2
    Last Post: 07-19-2005, 09:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts