-1

I made the suggested changes to the sendemail.php file, so the entire file now contains...

<?php
$name       = @trim(stripslashes($_POST['name'])); 
$from       = @trim(stripslashes($_POST['email'])); 
$subject    = @trim(stripslashes($_POST['subject'])); 
$message    = @trim(stripslashes($_POST['message'])); 
$to         = 'mail@URLREMOVED.co.uk';

$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";
$headers .= "From: {$name} <{$from}>\r\n";
$headers .= "Reply-To: <{$from}>\r\n";
$headers .= "Subject: {$subject}\r\n";
$headers .= "X-Mailer: PHP/".phpversion()."\r\n";

$sent = mail($to, $subject, $message, $headers);
die;

After attempting another test message, nothing was received in my email inbox at all.

Bobby Gavin
  • 3
  • 1
  • 7

1 Answers1

1

Try to replace :

$headers = "MIME-Version: 1.0\r\n";
$headers = "Content-type: text/plain; charset=iso-8859-1\r\n";
$headers = "From: {$name} <{$from}>\r\n";
$headers = "Reply-To: <{$from}>\r\n";
$headers = "Subject: {$subject}\r\n";
$headers = "X-Mailer: PHP/".phpversion()."\r\n";

with

$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";
$headers .= "From: {$name} <{$from}>\r\n";
$headers .= "Reply-To: <{$from}>\r\n";
$headers .= "Subject: {$subject}\r\n";
$headers .= "X-Mailer: PHP/".phpversion()."\r\n";

its failing because you did not set your $headers correctly, you override your headers, on each line just after you assigned a value, the next line you override previous value.

Masivuye Cokile
  • 4,754
  • 3
  • 19
  • 34