Page 1 of 1

PHP POST script

Posted: Wed Feb 21, 2007 7:32 pm
by sgpeters
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


I'm a PHP newbie and I have successfully written a simple PHP script to send out form data from a contact form on my flash-based website. The variables of my contact form fields are respectively: name, message, email, and message. I have a send button that sends out the data using the php script.

My PHP code is:

Code: Select all

<?
 
   $to = "steve@thepetersonproject.com";
   $msg = "$name\n\n";
   $msg .= "$message\n\n";

  mail($to, $subject, $msg, "From: contact\nReply-To: $email\n");

?>

It does send the message but when I view it in Outlook is looks like this:

Code: Select all

<TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Verdana\" SIZE=\"10\" COLOR=\"#000000\" LETTERSPACING=\"0\" KERNING=\"0\">John Smith</FONT></P></TEXTFORMAT>

<TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Verdana\" SIZE=\"10\" COLOR=\"#000000\" LETTERSPACING=\"0\" KERNING=\"0\">I like your site</FONT></P></TEXTFORMAT>
The subject line looks similar to all of this format jargon. Is there any way to make the format more precise? I just want to see the persons name, subject, email, and message.

Any help would be appreciated.


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Wed Feb 21, 2007 8:03 pm
by volka
Do $subject and/or $msg contain any html formatting. If not you're sending a plaintext mail and this isn't a php but outlook question.