Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 10-14-2007, 02:41 AM Mail Form Problem
Novice Talker

Posts: 12
Name: Marice Proudfoot
Trades: 0
Hello,

I made a mail to form in Flash, and it works as far as sending the message to the receiver. However, the phone no and everything is stuck in the "from" field. I want the sender's address in the "from" field and phone no., name, etc. in the message field. My code is:

<?php

$sendTo = "joeblow@yahoo.com";
$subject = "A message from joeblow.com";
$headers = "From: " . $_POST["name"] ." " . $_POST["phone"] ."<" . $_POST["email"] .">\r\n";
$headers .= "Reply-To: " . $_POST["email"] . "\r\n";
$headers .= "Return-path: " . $_POST["email"];
$message = $_POST["message"];
mail($sendTo, $subject, $message, $headers);
?>

This is probably simple, but I'm new to PHP. Thank you.
rockethead is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-14-2007, 05:22 PM Re: Mail Form Problem
rogem002's Avatar
PHP Chap

Posts: 843
Name: Mike
Location: United Kingdom
Trades: 0
Try:

PHP Code:
<?php
// If the variable has a comment next to it, it's been moved.

$sendTo "joeblow@yahoo.com";
$subject "A message from joeblow.com";
$headers "From: " $_POST["name"]/**/ ." " /*$_POST["phone"]*/  ."<" $_POST["email"] .">\r\n";
$headers .= "Reply-To: " $_POST["email"] . "\r\n";
$headers .= "Return-path: " $_POST["email"];
$message $_POST["message"]." ".$_POST["phone"]." ".$_POST["name"]  ;
mail($sendTo$subject$message$headers);
?>
__________________
My Blog/Site:
Please login or register to view this content. Registration is FREE
rogem002 is offline
Reply With Quote
View Public Profile Visit rogem002's homepage!
 
Old 10-14-2007, 05:59 PM Re: Mail Form Problem
Novice Talker

Posts: 12
Name: Marice Proudfoot
Trades: 0
Thank you I'll give it a try.
rockethead is offline
Reply With Quote
View Public Profile
 
Old 10-14-2007, 08:30 PM Re: Mail Form Problem
Novice Talker

Posts: 12
Name: Marice Proudfoot
Trades: 0
Didn't work. wouldn't even send the message. Is it even possible to include the phone number and such in the message field?
rockethead is offline
Reply With Quote
View Public Profile
 
Old 10-14-2007, 10:34 PM Re: Mail Form Problem
Novice Talker

Posts: 12
Name: Marice Proudfoot
Trades: 0
got it to work:

<?php
// If the variable has a comment next to it, it's been moved.

$sendTo = "joeblow@yahoo.com"
;
$subject = "A message from joeblow.com"
;
$headers = "From: " ."<" . $_POST["email"] .">\r\n"
;
$headers .= "Reply-To: " . $_POST["email"] . "\r\n"
;
$headers .= "Return-path: " . $_POST["email"
];
$message = $_POST["message"]." ".$_POST["phone"]." ".$_POST["name"
] ;
mail($sendTo, $subject, $message, $headers
);
?>



Took out some code so only email would appear in "from" field. Is there a way to make the message field look like this:

Name: Joe Blow
Phone: 555-555-5555
Message: Hello!

Any help appreciated.
rockethead is offline
Reply With Quote
View Public Profile
 
Old 10-15-2007, 03:42 PM Re: Mail Form Problem
solomongaby's Avatar
Webmaster Talker

Latest Blog Post:
How Do You Find Music Online ?
Posts: 522
Name: Gabe Solomon
Location: Romania
Trades: 1
it depends on how you have the initial form made
__________________
If you like my posts ... TK is appreciated:)

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
solomongaby is offline
Reply With Quote
View Public Profile Visit solomongaby's homepage!
 
Old 10-15-2007, 04:32 PM Re: Mail Form Problem
Novice Talker

Posts: 12
Name: Marice Proudfoot
Trades: 0
Its a flash form that simply sends the variables to the php form and i have the php posted. Pretty simple form.
rockethead is offline
Reply With Quote
View Public Profile
 
Old 10-15-2007, 04:41 PM Re: Mail Form Problem
solomongaby's Avatar
Webmaster Talker

Latest Blog Post:
How Do You Find Music Online ?
Posts: 522
Name: Gabe Solomon
Location: Romania
Trades: 1
i mean if you have included the fax,name and message field there
__________________
If you like my posts ... TK is appreciated:)

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
solomongaby is offline
Reply With Quote
View Public Profile Visit solomongaby's homepage!
 
Reply     « Reply to Mail Form Problem
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.26989 seconds with 12 queries