Answer the question
In order to leave comments, you need to log in
What's wrong with this code: $headers .= "From: ". $email. "\r\n";?
Hello!
The site has a feedback form.
Maybe I'm stupid, but I don't see the error at close range... The PHP script worked fine for two years, no one touched anything, and suddenly it stopped working.
***
Here is the top part of the script:
$to = "[email protected]";
$email = $_POST['email'];
$name = $_POST['name'];
$phone = $_POST['phone'];
$msg = $_POST['message'];
$subject = "Request from our site";
$headers = "MIME-Version: 1.0\r\n";
Answer the question
In order to leave comments, you need to log in
You cannot use other people's e-mail addresses in From, this violates DMARC and for domains with a strict DMARC policy (mail.ru, yahoo.com) letters will not reach. Put in From and envelope the addresses that your server is authorized to send, set up SPF and DKIM for the bottom. If you need to reply to letters, then put the user's address in the Reply-To.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question