Hey guys i am having this weird issue with sending information from my contact form to my email address. I have tested my code on local host through Xampp and i receive the emails perfectly fine, however when i uploaded the code to the server and submit. The success message shows as it should but no email is received, not even in the junk folder.
<?php
$name = $_POST['name1'];
$email = $_POST['email2'];
$message = $_POST['message3'];
$from = 'From: Testing';
$to = 'testing@hotmail.com';
$subject = 'Contact Form Testing';
$body = "From: $name
Email: $email
Message:
$message";
if ($_POST['submit']){
/*Do something when the submit has been pressed*/
if (mail ($to, $subject, $body, $from)){
$_SESSION['Success'] = '<div class="alert alert-success" role="alert">Your Message Has Been Sent!</div>';
header('Location: index.php#fifthpage');
} else{
$_SESSION['Error'] = '<div class="alert alert-danger" role="alert">Something Went Wrong Please Try Again!</div>';
header('Location: index.php#fifthpage');
}
}
?>