sending email from php

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shripal
    New Member
    • Jul 2008
    • 6

    sending email from php

    hello i am new to php.

    i want to email to client from my website.

    but i am not able to send email .

    it all time executes statement

    "Mail send failure - message not sent"

    as per my code given below.

    please help me to solve this problem or alternatively please provide some sample code .

    following is my sample code for sending email.

    [code=php]
    <?php
    $to = 'example@yahoo. com';
    $subject = 'the subject';
    $from = 'example@yahoo. com';
    $message = 'hello';

    if(mail($to, $subject, $message, "From: $from"))
    echo "Mail sent";
    else
    echo "Mail send failure - message not sent";
    ?>
    [/code]
    Last edited by Atli; Jul 23 '08, 02:02 AM. Reason: Added [code] tags
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    Read this about your php error messages.

    Try it out, n see if any errors are shown.

    Cheers.

    Comment

    Working...