I made a form to send an email using php and i got this error
<b>Warning</b>: mail(): "sendmail_from"
not set in php.ini or custom "From:"
header missing in <b>C:\xampp\htdocs\PHP-Contact-Form\messege.php</b>
$reciver = "myemail@gmail.com";
$subject = "form : $name <$email>?";
$body = "Name : $name \n Email : $email \n Phone : $phone \n Website : $website";
$sender = "From : $email";
if(mail($reciver,$subject,$body,$sender)){
}else{echo "Failed To Send Your Message !
}
Solution : You need a SMTP Server to send emails using php because mail() function requires a MTA(Mail Transfer Agent) to work and it will not work if you use a local server like XAMPP.
1.You Can Setup SMTP on XAMPP locally .. see this question for more info How to setup mail in XAMPP locally?
2.You can use PHPMailer class at https://github.com/PHPMailer/PHPMailer it allows you to use the mail function or use a SMTP server transparently
3.Use Swift mailer https://swiftmailer.symfony.com/docs/introduction.html