Answer the question
In order to leave comments, you need to log in
Why are emails not coming from WordPress?
Hello.
Tell me, please, where to look and what to look for?
I know that many people ask questions about this topic. I read a lot of things, but I did not find the answer to my question.
The site is powered by WordPress - https://potolki-plafond.ru/
Previously, letters to the mail came without problems. A few days ago, letters stopped coming, although the site says that YOUR LETTER IS SENT.
I use the email-send.php file to send emails.
Here is the code from this file
<?php
if ($_POST){
function mime_header_encode($str, $data_charset, $send_charset) {
if($data_charset != $send_charset)
$str=iconv($data_charset,$send_charset.'//IGNORE',$str);
return ('=?'.$send_charset.'?B?'.base64_encode($str).'?=');
}
class TEmail {
public $from_email;
public $from_name;
public $to_email;
public $to_name;
public $subject;
public $data_charset='UTF-8';
public $send_charset='windows-1251';
public $body='';
public $type='text/plain';
function send(){
$dc=$this->data_charset;
$sc=$this->send_charset;
$enc_to=mime_header_encode($this->to_name,$dc,$sc).' <'.$this->to_email.'>';
$enc_subject=mime_header_encode($this->subject,$dc,$sc);
$enc_from=mime_header_encode($this->from_name,$dc,$sc).' <'.$this->from_email.'>';
$enc_body=$dc==$sc?$this->body:iconv($dc,$sc.'//IGNORE',$this->body);
$headers='';
$headers.="Mime-Version: 1.0\r\n";
$headers.="Content-type: ".$this->type."; charset=".$sc."\r\n";
$headers.="From: ".$enc_from."\r\n";
return mail($enc_to,$enc_subject,$enc_body,$headers);
}
}
$name = $_POST['name'];
$date = $_POST['date'];
$time = $_POST['time'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$url = $_POST['url'];
$address = $_POST['address'];
$tovar = $_POST['tovar'];
$name_company = $_POST['name_company'];
$name_training = $_POST['name_training'];
$quantity = $_POST['quantity'];
$demands = $_POST['demands'];
if ($name) {
$message .= "Имя - ".$name;
}
if ($phone) {
$message .= "\nТелефон - ".$phone;
}
if ($email) {
$message .= "\nemail - ".$email;
}
if ($date) {
$message .= "\nДата - ".$date;
}
if ($time) {
$message .= "\nВремя - ".$time;
}
if ($address) {
$message .= "\nАдрес - ".$address;
}
if ($tovar) {
$message .= "\nТовар - ".$tovar;
}
if ($name_company) {
$message .= "\nНазвание компании - ".$name_company;
}
if ($name_training) {
$message .= "\nНазвание треннинга - ".$name_training;
}
if ($quantity) {
$message .= "\nКол-во человек - ".$quantity;
}
if ($demands) {
$message .= "\nСообщение - ".$demands;
}
$emailgo= new TEmail;
$emailgo->from_email= 'SIP';
$emailgo->from_name= 'SIP';
$emailgo->to_email= '[email protected]';
$emailgo->to_name= 'SIP';
$emailgo->subject= 'Заявка с сайта Potolki-Plafond:';
$emailgo->body= $message;
$emailgo->send();
echo $messsage; //для debug
}
else{
echo 'access denial';
}
?>
Answer the question
In order to leave comments, you need to log in
So far, unfortunately, the problem has not been solved.
The programmers at the hosting said that you need to look at the server logs.
I looked at the logs - when sending an application from the forms, it gives an error.
[Tue Jul 07 18:58:52.537406 2020] [fcgid:warn] [pid 29253] [client 176.59.48.142:40208] mod_fcgid: stderr: PHP Notice: Undefined variable: messsage in /home/admin/web/potolki-plafond.ru/public_html/wp-content/themes/potolki-plafond/email-send.php on line 103, referer: https://potolki-plafond.ru/
[Tue Jul 07 18:58:35.018688 2020] [fcgid:warn] [pid 28915] [client 176.59.48.142:40204] mod_fcgid: stderr: PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'create_my_post_types' not found or invalid function name in /home/admin/web/potolki-plafond.ru/public_html/wp-includes/class-wp-hook.php on line 287, referer: https://potolki-plafond.ru/pongs/
[Tue Jul 07 18:58:52.537375 2020] [fcgid:warn] [pid 29253] [client 176.59.48.142:40208] mod_fcgid: stderr: PHP Notice: Undefined variable: message in /home/admin/web/potolki-plafond.ru/public_html/wp-content/themes/potolki-plafond/email-send.php on line 62, referer: https://potolki-plafond.ru/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question