mail function didn't work in my local system

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • swethak
    New Member
    • May 2008
    • 118

    mail function didn't work in my local system

    hi,

    i used mail function in my local system.In that i didn't get any errors and mail didn't receive.And in my php.ini consists

    [mail function]
    ; For Win32 only.
    SMTP = localhost
    smtp_port = 25

    ; For Win32 only.
    sendmail_from = me@example.com

    at the time of installation of php it asks the smtp and from address.And i give as smtp=localhost and from address as me@example.com

    And my php code is

    [php]
    <?php
    $to = "sravanik@examp le.com";
    $subject = "Test mail";
    $message = "Hello! This is a simple email message.";
    $from = "me@example.com ";
    $headers = "From: $from";
    mail($to,$subje ct,$message,$he aders);
    echo "Mail Sent.";
    ?>
    [/php]

    Anybody plz tell that what's the solution for that.plz help me.
    Last edited by Atli; Jul 26 '08, 11:42 PM. Reason: Replaced real email with example.com
  • Gulzor
    New Member
    • Jul 2008
    • 27

    #2
    SMTP=localhost

    use that if you have a running mail server installed on the computer/server that hosts your script.

    if you're just testing at home, use the smtp of your isp.

    Comment

    Working...