Mail function doesn't work

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shaiful
    New Member
    • Oct 2007
    • 89

    Mail function doesn't work

    Hi all, I used mail function to send a mail. the code:
    [code=php]
    <?php
    $to = "shaiful@vvv.co m";
    $subject = "New Online Prayer Request";
    $message ="kk";
    $txtReply = "ll";

    $headers = "xxx";

    $sent = mail($to, $subject, $message, $headers);

    if($sent)
    {
    echo "Message Sent Successfully";
    } else {
    echo "There Was an Error Sending Your Message";
    }
    ?>
    [/code]
    The mail function doesnt work , its say : Failed to Receive in C:\apache\htdoc s\email\index.p hp on line 10

    If u have any idea , pls help me, also how i can use BCC with that? thx a lot
    Last edited by ak1dnar; Jan 15 '08, 02:16 AM. Reason: Fixed CODE tags
  • ak1dnar
    Recognized Expert Top Contributor
    • Jan 2007
    • 1584

    #2
    You need to set the SMTP server in the php.ini file. Do you have one. is this your local machine or hosting server?

    Comment

    • shaiful
      New Member
      • Oct 2007
      • 89

      #3
      Originally posted by ajaxrand
      You need to set the SMTP server in the php.ini file. Do you have one. is this your local machine or hosting server?
      Hi thx a lot 4 ur reply, it is my local machine, so what i need to do pls?

      Comment

      • ak1dnar
        Recognized Expert Top Contributor
        • Jan 2007
        • 1584

        #4
        Originally posted by shaiful
        Hi thx a lot 4 ur reply, it is my local machine, so what i need to do pls?
        I don't know which OS you have there, I think you know how to find the php.ini file and why don't you check the SMTP settings first. And Let me know how its looks like.

        SMTP = mail.YOUR_ISP_N OT_MINE.com
        smtp_port = 25

        Comment

        • shaiful
          New Member
          • Oct 2007
          • 89

          #5
          Originally posted by ajaxrand
          I don't know which OS you have there, I think you know how to find the php.ini file and why don't you check the SMTP settings first. And Let me know how its looks like.

          SMTP = mail.YOUR_ISP_N OT_MINE.com
          smtp_port = 25
          Sorry Ajaxrand,
          I i using windows XP OS, and i dont where the php.ini is? could u pls explain me bit more? Thx very much

          Comment

          Working...