0

why i can't send email in localhost but when i try in hosting it can send email this my code **

define('ROOT', 'localhost/OMG1/');
$kode = md5(uniqid(rand()));
$to = $_GET['f11'];
        $headers = "From: rizka.nugroho@omg-indonesia.com\r\n";
        $headers .= "Reply-to: $to\r\n";
        $pesan    = "Klik link berikut untuk verifikasi dan mengaktifkan akun : ";
        $pesan    .= ROOT."active.php?email=".$_GET['f11']."&kode=$kode&username=".$_GET['f5'];var_dump($pesan);
$a = @mail($to, "Aktivasi Akun Anda", $pesan, $headers);var_dump($a); 
if($a)
        {
            echo "Email send";
        }
        else
        {
            echo "failed to send mail";
        }

** please help solved my problem

Nugka
  • 301
  • 2
  • 15

1 Answers1

1

You need to configure your email settings on XAMPP. A quick search on stack overflow shows that someone already asked a question like this and received and answer...

How to configure XAMPP to send mail from localhost?

Please try and use the search function first next time.

Community
  • 1
  • 1
msafi
  • 377
  • 1
  • 5
  • 19