0

Excuse me, I am learning to build a simple contact form on my customed website. I want to send an email via mail() but no mails are received. How do I set it via Sendmail path?

PHP mail official manual

<?php
if (isset($_POST['email'])) {

//Email information
$to="[email protected]";
$subject='New Form Submission';
$name=$_POST['name'];
$email=$_POST['email'];
$phone=$_POST['phone'];
$message=$_POST['message'];

//send email
mail($to,$subject,$message);

header('Location:success.html');
}

?>
Lyu JH
  • 131
  • 9
Joseph
  • 80
  • 14

2 Answers2

0

You are setting the address you want the mail to be sent to as '[email protected].' you should change it to mail($email, $subject, $message);

0

//send email

mail($to,$subject,$message,[email protected]);
kealaxshan
  • 338
  • 2
  • 14