Answer the question
In order to leave comments, you need to log in
Form submission not sending emails to gmail, how to fix?
There is a php script that sends letters from the server to the mailbox.
Previously, everything worked, and letters reached gmail, but now they don’t want to send them to anyone, I think it’s a php script, I just don’t understand this much, you can look, advise what and how to do.
Here is the code itself:
<?
$kuda='[email protected]';//куда отправлять почту?
$zagolovok='Новая заявка';
$headers='Content-type: text; charset="utf-8"';
$ss='Ваша заявка отправлена. Наш менеджер обязательно с Вами свяжется!';
if (isset($_POST['ok'])){
//если существует переменная, значит начнем получать информацию из формы
$fio=$_POST['fio'];
$email=$_POST['email'];
$tel=$_POST['tel'];
$text=$_POST['text'];
$messages=$text."\n".$fio."\n".$email."\n".$tel;
if (mail($kuda,$zagolovok,$messages,$headers)){header("Location: ../thanks.htm");}
}
?>
Answer the question
In order to leave comments, you need to log in
Sending e-mail is a topic that is actually very nuanced. PHP has little to do with it, it just passes your letter to the MTA.
If you want to achieve acceptable deliverability, use a special service like mailgun.com or similar.
My gmail considers them spam, for this, in gmail itself, add your address to the exceptions so that letters from the form reach gmail users, you can use the gmail address, that is, connect to it using php and then use it as you need. There are already many scripts for this. But do not forget that for this the server must support OpenSSL.
PS Notifications work for me according to your scheme, just the address is added to the exceptions.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question