Ok, I tried this: (Pay attention to the emails with domains)
<?php
$headers = "From: admin@MYDOMAIN.com\r\n";
$headers .= "Reply-to: example@GMAIL.com\r\n";
$headers .= "X-Mailer: PHP/" . phpversion();
$company = $_REQUEST['company'];
$version = $_REQUEST['version'];
$quantity = $_REQUEST['quantity'];
$name = $_REQUEST['name'];
$phone = $_REQUEST['phone'];
// some basic email header injection prevention:
$email = preg_replace('/[\r\n]+/', ' ', $_REQUEST['email']);
$notes = $_REQUEST['notes'];
$msg = "$company
$quantity
$name
$phone
$email
$notes";
if(mail("example@GMAIL.com", "Ink Cartridge Order", $msg, $headers))
header("Location: http://www.MYDOMAIN.com");
else
print_r(debug_backtrace());
?>
And it looked like it worked, and it took me to the right site, but I didn't get the email. I then tried this, like rulian said:
<?php
$headers = "From: admin@MYDOMAIN.com\r\n";
$headers .= "Reply-to: example@GMAIL.com\r\n";
$headers .= "X-Mailer: PHP/" . phpversion();
$company = $_REQUEST['company'];
$version = $_REQUEST['version'];
$quantity = $_REQUEST['quantity'];
$name = $_REQUEST['name'];
$phone = $_REQUEST['phone'];
// some basic email header injection prevention:
$email = preg_replace('/[\r\n]+/', ' ', $_REQUEST['email']);
$notes = $_REQUEST['notes'];
$msg = "$company
$quantity
$name
$phone
$email
$notes";
if(mail("example@GMAIL.com", "Ink Cartridge Order", $msg, $headers))
header("Location: http://www.MYDOMAIN.com");
else
print_r(debug_backtrace());
echo "<pre>";
print_r($_REQUEST);
echo "</pre>";
?>
On that, I added the:
echo "<pre>";
print_r($_REQUEST);
echo "</pre>";
I still didn't get the email. Is something with the email From: and Reply To: still wrong?