0

Hi I was trying to send Email using php in xammp I have already started Mercury Service

Heres my code

<?php



$to = "nikhil08514@gmail.com";
$subject = "Hi!";
$body="test";

$headers = "From: root@localhost.com"; 

if (mail($to, $subject, $body, $headers)) 
{
echo "Message successfully sent!";
} 

else

{
echo "Message delivery failed...";
}
?>

when i execute code i am getting output as

Message successfully sent!

But when i check my mail box.I dont see mail.I checked all folders in my Mailbox but its not present

nikhil
  • 877
  • 3
  • 11
  • 36

1 Answers1

0

your code is right try that on server it will work surely, xampp does not send directly like that from xammp. by using smtp you can send.

Daman Mokha
  • 372
  • 1
  • 3
  • 16