Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jul 2008
    Posts
    57
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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 Code:
    <?php
    $to 
    "sravanik@eminosoft.com";
    $subject "Test mail";
    $message "Hello! This is a simple email message.";
    $from "me@example.com";
    $headers "From: $from";
    mail($to,$subject,$message,$headers);
    echo 
    "Mail Sent.";
    ?>
    Anybody plz tell that what's the solution for that.plz help me.

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    You need your own smtp server to send mail from your local system. Localhost won't work.
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Posting Permissions

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