sending smtp mail
I am sending a mail through our smtp server using php.
this is wriiten in "test/sendmail.php".
The code works fine when I use "localhost/testsendmail.php"
I have a page test.php with a button on it.
I can access sendmail.php from my test.php page.
but I get the message "require_once(Mail.php) [function.require-once]: failed to open stream: No such file or directory in C:\xampp\htdocs\iMoni\sendmail.php on line 7 "
looks like it is not accepting the path Mail.php
I can figure out why.
appreciate any help given. thanks and regards,
Is there, in fact, a "Mail.php" file on that server, either in the same directory as the script doing the require() or in your configured PHP include_path? Does it have read permission for all?
Thank you for the reply.
yes there is the file in the server and is in my include_path.
but I figured out what is wrong. I have put a set_include_path(../) at the top of my code.
so when I look for mail.php set include path looks for ../mail.php so it works when I remove that.
But coming to another problem I thought set include path would first check mail.php and if it doesn't exist it goes to ../ mail php.
You probably also want "." in the include_path (for the current directory). In any case, you can add something to the include path without blowing away the existing setting with something like:
$path = ".." . DIRECTORY_SEPARATOR;
set_include_path($path . PATH_SEPARATOR . get_include_path());
sorry for the late reply. Thank you. Ill try that.
Thanks NogDog. the final include path worked beautifully.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread