www.webdeveloper.com
Results 1 to 6 of 6

Thread: sending smtp mail

  1. #1
    Join Date
    Jul 2011
    Posts
    4

    sending smtp mail

    Hi,

    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.
    Now what I want to do is when a button is clicked; using javascript and ajax it will access the sendmail.php file and send the mail and the result "mail sent or error " will be displayed in the test.php page.

    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,

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,609
    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?
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Jul 2011
    Posts
    4
    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.

  4. #4
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,609
    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:
    PHP Code:
    $path ".." DIRECTORY_SEPARATOR;
    set_include_path($path PATH_SEPARATOR get_include_path()); 
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  5. #5
    Join Date
    Jul 2011
    Posts
    4
    sorry for the late reply. Thank you. Ill try that.

  6. #6
    Join Date
    Jul 2011
    Posts
    4
    Thanks NogDog. the final include path worked beautifully.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles