This question has already been answered:
Hello!
I wrote feedback on PHP and everything works fine, but here is one BUT, if you type in the email field βtest@gmail.comβ, then everything works, but if you enter βtest@mail.ruβ, then the letter is not sent at all. Mail, where the letter comes from Google.
<form id="application" action="php/send.php" method="POST" name="application "> <input name="name" id="name" maxlength="20" placeholder="ΠΠ²Π΅Π΄ΠΈΡΠ΅ Π²Π°ΡΠ΅ ΠΈΠΌΡ" required /> <input name="email" type="email" id="email" maxlength="40" placeholder="ΠΠ²Π΅Π΄ΠΈΡΠ΅ Π²Π°Ρ E-mail" required/> <input name="telephone" type="Tel" id="telephone" maxlength="20" placeholder="ΠΠ²Π΅Π΄ΠΈΡΠ΅ Π²Π°Ρ ΡΠ΅Π»Π΅ΡΠΎΠ½" required /> <button class="FormButton" type="submit" form="application"><i class="fa fa-envelope" aria-hidden="true"></i> ΠΠΎΠ»ΡΡΠΈΡΡ ΠΏΡΠ°ΠΉΡ </button> </form> <?php $sendto = "the.ivan.smirnov@gmail.com"; // ΠΏΠΎΡΡΠ°, Π½Π° ΠΊΠΎΡΠΎΡΡΡ ΠΏΡΠΈΡ
ΠΎΠ΄ΠΈΡ ΠΏΠΈΡΡΠΌΠΎ $username = $_POST['name']; // Π΄Π°Π½Π½ΡΠ΅ ΠΈΠ· ΠΏΠΎΠ»Ρ Ρ ΠΠΌΡ $usertel = $_POST['telephone']; // Π΄Π°Π½Π½ΡΠ΅ ΠΈΠ· ΠΏΠΎΠ»Ρ Π’Π΅Π»Π΅ΡΠΎΠ½ $usermail = $_POST['email']; // Π΄Π°Π½Π½ΡΠ΅ ΠΈΠ· ΠΏΠΎΠ»Ρ Email // Π€ΠΎΡΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ Π·Π°Π³ΠΎΠ»ΠΎΠ²ΠΊΠ° ΠΏΠΈΡΡΠΌΠ° $subject = "ΠΠΎΠ²ΠΎΠ΅ ΡΠΎΠΎΠ±ΡΠ΅Π½ΠΈΠ΅"; $headers = "From: " . strip_tags($usermail) . "\r\n"; $headers .= "Reply-To: ". strip_tags($usermail) . "\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html;charset=utf-8 \r\n"; // Π€ΠΎΡΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ ΡΠ΅Π»Π° ΠΏΠΈΡΡΠΌΠ° $msg = "<html><body style='font-family:Arial,sans-serif;'>"; $msg .= "<h2 style='font-weight:bold;border-bottom:1px dotted #ccc;'>CΠΎΠΎΠ±ΡΠ΅Π½ΠΈΠ΅ Ρ ΡΠ°ΠΉΡΠ° RECO</h2>\r\n"; $msg .= "<p><strong>ΠΡ ΠΊΠΎΠ³ΠΎ:</strong> ".$username."</p>\r\n"; $msg .= "<p><strong>ΠΠΎΡΡΠ°:</strong> ".$usermail."</p>\r\n"; $msg .= "<p><strong>Π’Π΅Π»Π΅ΡΠΎΠ½:</strong> ".$usertel."</p>\r\n"; $msg .= "</body></html>"; // ΠΎΡΠΏΡΠ°Π²ΠΊΠ° ΡΠΎΠΎΠ±ΡΠ΅Π½ΠΈΡ if(@mail($sendto, $subject, $msg, $headers)) { echo "<center><h1>Π‘ΠΎΠΎΠ±ΡΠ΅Π½ΠΈΠ΅ ΡΡΠΏΠ΅ΡΠ½ΠΎ ΠΎΡΠΏΡΠ°Π²Π»Π΅Π½Π½ΠΎ</h1><br><h2>ΠΡ ΡΠ²ΡΠΆΠ΅ΠΌΡΡ Ρ Π²Π°ΠΌΠΈ Π² Π±Π»ΠΈΠΆΠ°ΠΉΡΠ΅Π΅ Π²ΡΠ΅ΠΌΡ! </h2></center>"; } else { echo "<center><img src='img/ne-otprevleno.png'></center>"; } ?>