PHP Mail Function
        Posted  
        
            by 
                vgathan
            
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by vgathan
        
        
        
        Published on 2010-12-21T13:43:33Z
        Indexed on 
            2010/12/21
            13:54 UTC
        
        
        Read the original article
        Hit count: 214
        
php
Is it possible to send a mail in PHP without any external packages or tools? If so, is there
any requirement to configure the php.ini file?
Its as follows:
$to = $row->EMail_ID;
        $subject = "Reset your password";
        $body = "Hi ".$row->Username.", \n\t\t\tA request to reset your  password was received from you. \n\n\n";
        $headers = "From: [email protected]\r\n"."X-Mailer: php/";
        mail($to, $subject, $body, $headers); 
The error i get:
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 F:\wamp\www\pwd.php on line 20
© Stack Overflow or respective owner