This question already has an answer here:
i've searched for hours for a solution but i just don't get it. I'm fairly new to PHP, I'm doing a project where i need an email to be sent, the problem is that I can't figure how to do it. Others who had the same problem, fixed it by configuring the php.ini and the sendemail.ini
This is my current code for testing:
<?php
$subject="Hi There!!";
$to="mygmail@gmail.com";
$body="This is a demo email sent using PHP on XAMPP";
if (mail($to,$subject,$body)){
echo "Mail sent successfully!";
}
else{
echo "Mail not sent!";
}
?>
I receive the "Mail sent successfully" but there is nothing on my inbox, not even on the spam folder. I also tried to use PHPMailer but (like i said) im fairly new to php and i don't get how to enable it on my code. What do you guys think?
</div>