E-mail Form: Send to address given by user?

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
lrsdscout
Forum Newbie
Posts: 1
Joined: Wed Nov 29, 2006 9:48 pm

E-mail Form: Send to address given by user?

Post by lrsdscout »

I would like to make a simple form that has 2 boxes:

box 1 = user enters a friend's e-mail address

box 2 = user enters a message

user then hits a submit button and the message is sent to e-mail address is box 1. Is this possible?

I have made plenty of "regular" PHP feedback forms, but I can't figure out how to connect the address in box 1 to the mail($sendTo, etc.);

I'll send $1 paypal to anyone that can solve this for me :D
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

Code: Select all

mail($_POST['to'],"some subject",$_POST['body']);
User avatar
Cameri
Forum Commoner
Posts: 87
Joined: Tue Apr 12, 2005 4:12 pm
Location: Santo Domingo, Dominican Republic

Post by Cameri »

Of course, your webserver must have the smtp configured or you'll have to do it by yourself.
Burrito, this is your one time chance to earn $1!
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

Cameri wrote:Burrito, this is your one time chance to earn $1!
I think I'll be ok w/o that dollar, someone else should get it.
Post Reply