D
D
danilazharikov2018-06-30 18:03:25
PHP
danilazharikov, 2018-06-30 18:03:25

How to setup mail() function in php?

I can't send email, here is the code:

<?php
       $to= "[email protected]" ;
        $message="Помагите";
        $subject = "Birthday Reminders for August";
        $headers = 'From: [email protected]'; 
mail($to,$subject, $message, $headers);
?>

gives this error:
Warning: 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:\xampp\htdocs\MySite \index.php on line 7
PLEASE EXPLAIN WHAT TO DO?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question