Jump to content

Quick Help on Mailing Function


prcollin

Recommended Posts

 

 

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.