You are here: Re: Need help with sending HTML formatted emails « PHP Programming Language « IT news, forums, messages
Re: Need help with sending HTML formatted emails

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация