2

I'm trying to send email using smtp but it seem error occur at line

require_once('Mail.php');

(source:http://stackoverflow.com/questions/712392/send-email-using-gmail-smtp-server-from-php-page)

Warning: require_once(Mail.php): failed to open stream: No such file or directory in /Applications/MAMP/htdocs/p/forgot.php on line 4

Fatal error: require_once(): Failed opening required 'Mail.php' (include_path='.:/Applications/MAMP/bin/php/php5.4.4/lib/php') in /Applications/MAMP/htdocs/p/forgot.php on line 4

this's the message when I typed: pear -V

PEAR Version: 1.9.4 PHP Version: 5.4.4 Zend Engine Version: 2.4.0 ...

How can I include 'Mail.php' after installed pear?

This problem is solved by

check where the path install

$ pear config-get php_dir

then change include_path in php.ini file

Community
  • 1
  • 1
ajjumma
  • 103
  • 2
  • 3
  • 11

1 Answers1

1

If I understand correctly, you want to use the mail() function?

I've never had to require or include it when using it, once it's been set up. Usually my PHP environment picks up everything in the default include paths.

http://php.net/manual/en/function.mail.php

Stegrex
  • 4,004
  • 1
  • 17
  • 19