prcollin Posted May 19, 2008 Share Posted May 19, 2008 If i have a form that has the following html fields <input type="text" name="recipient"> sender subject message how could i get the field fromt he form to be entered into the php code. Can I just add $to = "recipient" or do i have to declare it ahead of time liek $to = 'recipient'; $from = 'sender'; etc etc <?php $to = "[email protected]"; $subject = "Test mail"; $message = "Hello! This is a simple email message."; $from = "[email protected]"; $headers = "From: $from"; mail($to,$subject,$message,$headers); echo "Mail Sent.";?> Link to comment https://forums.phpfreaks.com/topic/106366-quick-help-on-mailing-function/ Share on other sites More sharing options...
jonsjava Posted May 19, 2008 Share Posted May 19, 2008 $to = $_POST['recipient']; Link to comment https://forums.phpfreaks.com/topic/106366-quick-help-on-mailing-function/#findComment-545233 Share on other sites More sharing options...
prcollin Posted May 19, 2008 Author Share Posted May 19, 2008 $to = $_POST['recipient']; ok gotcha thanks for that!! TOPIC SOLVED Link to comment https://forums.phpfreaks.com/topic/106366-quick-help-on-mailing-function/#findComment-545241 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.