I'm having trouble with a VERY basic php mail bit of code:
<?php
$email_address = "test@mydomain.com";
$subject = "Message yay";
$email = "test@email.com";
$message = "huh? " . $email . " this should work";
//$headers .= "From: 'test' <test@mydomain.com> \n";
$headers .= "Reply-To: test@mydomain.com \n";
$headers .= "Return-Path: test@mydomain.com \n";
$headers .= "X-Mailer: PHP/" . phpversion() . "\n";
$headers .= "X-Priority: 1\n";
//$headers .= "X-MSMail-Priority: High\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
mail( $email_address , $subject , $message , $headers);
?>
First off this was working then suddenly didn't after a week or so, So i'm guessing my web host has screwed around with things and not told me. Second I found through trail and error that the two header lines commented out will prevent the email from being sent if they are included (although mail function will return true).
Now here comes the funny part, the code as it is wont send for me either (although mail function will return true), because of the email being inserted in the the message, i wish i could put the email in the reply-to headers but that wont work for me either (although mail function will return true).
Anyway what I really want to know is how do I put the email address in the message in such a way that this will send but also appear as a email address in the message? (because nothing else will work).
I have tired urlencode() which while it works, comes out rather ugly in the email and isn't a solution.