Results 1 to 4 of 4

Thread: Mail function @PHP

  1. #1
    Join Date
    Nov 2004
    Location
    United kingdom
    Posts
    20

    Default Mail function @PHP

    i am very beginner of PHP. i am trying to use mail function with differnt type of web server, the code is bellow

    <?php
    $to = "[email protected]";
    $from = "[email protected]";
    $subject = "This is a test email";
    $message = "Dear John,\n\nThis is a fake email, I hope you enjoy it.\n\nFrom Jane.";

    $headers = "From: $from\r\n";

    $success = mail($to, $subject, $message, $headers);
    if ($success)
    echo "The email to $to from $from was successfully sent";
    else
    echo "An error occurred when sending the email to $to from $from";
    ?>
    i know this is correct code, but it didnto work with many web server . at last its works at bizhat web server.
    now my question is : is there any server configeration needed to use this mail function ??
    like send mail path or localhost path,
    pls help me to find out this problem

  2. #2
    Join Date
    Nov 2004
    Posts
    6

    Default

    the only things you would need, would be some mail server, and a good version of PHP. Somtimes windows servers have different PHP syntax to fallow.

  3. #3
    Join Date
    Nov 2004
    Location
    NYS
    Posts
    29

    Default

    I can't answer your question, but maybe :

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

    can be of some help.

    good luck

  4. #4
    Join Date
    Nov 2004
    Posts
    251

    Default

    Hian My mail function is too not working , please admin start a thread for Mail function tooo

Bookmarks

Posting Permissions

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