Mail Function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • anandaraman
    New Member
    • Feb 2007
    • 8

    #1

    Mail Function

    Hi all. i need help from u. i use the mail function, but error displays. how to rectify. please help
    the coding is

    <?php
    $to = "somebody@examp le.com";
    $subject = "My subject";
    $txt = "Hello world!";
    $headers = "From: webmaster@examp le.com";
    mail($to,$subje ct,$txt,$header s);
    ?>

    the error is

    Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\Program Files\xampp\htd ocs\textexample \mailfn.php on line 6
  • newladder
    New Member
    • Jan 2007
    • 15

    #2
    Your php code is correct,
    you are not allowed to send mail because you need to configure your php.ini file with SMTP function and port.

    Comment

    Working...