V
V
vik73352018-05-01 14:57:53
WordPress
vik7335, 2018-05-01 14:57:53

Not receiving emails from wordpress site?

Website xxx.devshift.co.uk
Here is the handler

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <title><?php bloginfo('name') ?></title>
  <link rel="stylesheet" href="<?php bloginfo('stylesheet_url') ?>">
  <style>
    html, body {
      min-height: 100%;
      padding: 0;
      margin: 0;
    }

    body {
      min-height: 100vh;
    }

    
  </style>
</head>
<body>
<?php
/*
Template Name: Contacting - Mail Handler
*/
if (isset($_POST['name'])) {$name = $_POST['name']; if ($name == '') {unset($name);}}
if (isset($_POST['email'])) {$email = $_POST['email']; if ($email == '') {unset($email);}}
if (isset($_POST['phone'])) {$phone = $_POST['phone']; if ($phone == '') {unset($phone);}}
if (isset($name) && isset($email)){
if ($_POST['dev-form']) {$formType = $_POST['dev-form'];}
$address = "[email protected], [email protected]";
$message = "Name: $name \nE-mail: $email \nTelephone number: $phone\nForm type: $formType\n\nThis message is generated by submitting contact Form";
$send = mail($address,"Submitted Contact Form | Devshift",$message,"Content-type:text/plain; charset = UTF-8"); // 
if ($send == 'true')
{echo "<div class='message__form'>Thank you for the request!\nWe will contact you during one business day\n<br><a href='http://xxx.devshift.co.uk'><- Back to the website</a></div>";}
else {echo "<div class='message__form'>Something went wrong - we can't send the request. Try to send it again please\n<br><a href='http://xxx.devshift.co.uk'><- Back to the website</a></div>";}
}
else
{
echo "<div class='message__form'>You haven't filled all required fields!\n<br><a href='http://xxx.devshift.co.uk'><- Back to the website</a></div>";
}
?>
</body>
</html>

If you do not fill in the fields in the form, a notification appears that not all fields are filled. Those. the form calls the handler. In the admin panel, I did as I was advised: I created an empty page and assigned a handler to it as a template. But the letters still do not come, and it is not known where they go (
5ae855d095fdd263345238.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2018-05-01
@vik7335

1. Perhaps the use of mail () is disabled in the settings. This is a hell hole and is usually disabled because you have to send mail via smtp. so check your settings.
2. mail() in win behaves differently than on unix. What is your OS?
3. Remove everything that is possible for the test, special characters, line breaks, the second enail of the recipient, etc. Check on the basis. Simple headers, text, 1 email. The recipient is not mail.ru and its analogues, since their spam filter will definitely eat the letter sent via mail().
4. What did you decide that does not work? The fact that it does not reach is not yet a sign that it is not being sent.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question