Hello there!
I have a simple emailing function which sends form results as an e-mail. I’m using it as a contact us and I’m trying to make send e-card functionality. Everything works fine (I load picture, text, addresses etc, put it into simple html mail and send). The problem is that I receive the mail from my server email address, not from the one specified in headers.
[php]
$email_from = "[email protected]";
$email_subject = “User $name just sent you this ecard”;
$ecard = "
New ecard from user $name
$message\n
Some footer text...
$headers = ‘From: $email_from . \n’;
$headers .= ‘Reply-To: $visitor_email . \n’;
$headers = ‘MIME-Version: 1.0’ . “\n”;
$headers .= ‘Content-type: text/html; charset=iso-8859-1’ . “\n”;
$to = “$rec_email”;
$email_body = “$ecard”;
mail($to, $email_subject, $email_body, $headers);
[/php]
First two lines of headers simply don’t work and are overwritten. When I remove the latter two headers, everything works fine (from and reply-to) but the e-mail is displayed as a plain text. I need to send html email but I need to include from and reply-to as well. Any ideas?
I’m new to php, so excuse my ignorance in not getting to right solution myself. Any ideas will be strongly appreciated.