PHP POST script

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sgpeters
Forum Newbie
Posts: 1
Joined: Wed Feb 21, 2007 7:20 pm

PHP POST script

Post 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]
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post 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.
Post Reply