|
Posted by Big Moxy on 10/01/07 04:26
On Sep 30, 10:16 pm, Big Moxy <bigm...@gmail.com> wrote:
> Here is my code for formatting an HTML email. I know that spinning
> through the $_POST array as I am isn't very pretty but it's a long
> list so for now I'm using this approach. The problem is that despite
> setting the Content-type the resulting email arrives in plain text.
> Outlook 2003 is my email client and I receive HTML emails without a
> problem.
>
> Can someone please advise me on what I'm doing wrong?
>
> $to_address = "t...@mysite.com";
> $from_address = "webm...@mysite.com";
> $subject = "Evaluation Request";
> $headers = "MIME-Version: 1.0\r\n";
> $headers.= "Content-type: text/html; charset=iso-8859-1\r\n";
> $headers.= "From: $from_address\r\n";
> $message = "";
> foreach ( $_POST as $key => $value ) {
> $message.= "<b>" . $key . "</b>" . " " . ":" . " " . $value . "<br />";
> };
>
> $_SESSION['sent_message'] = "Thank you for your request! Someone will
> be contacting you soon.";
> mail($to_address, $subject, $message, $headers);
> header = ("location: index.php");
>
> Thank you!
> - Tim
NEVER MIND! My emails are taking longer to arrive than expected.
However I received a plain text email after I had changed my code so
that the headers were set before creating the message and just assumed
there still was a problem. However after my post a new email arrived
an it was formatted as expected.
Navigation:
[Reply to this message]
|