Page 1 of 1

how recepient to contact form

Posted: Wed Nov 05, 2008 1:02 pm
by tonyledenko
Hello,

How can I send the form results to the person who fills it out. Currently, I am having it sent to me.

//The email address the message will be sent to
$youremail = "ttttt@ttttt.com";

<?

//Checks to see if the name field is empty. You can delete or add fields as needed.

if ( (!empty($name)))
{

$name = stripslashes($name);
$message = stripslashes($message);
//This is where the email is sent using your values from above.
mail("$youremail", "$subject","$thetext");
?>

Re: how recepient to contact form

Posted: Wed Nov 05, 2008 1:28 pm
by requinix
tonyledenko wrote:Currently, I am having it sent to me.
So just change the To address.

Or if you want it send to them as well, copy/paste the mail(...) statement and change the address.

Re: how recepient to contact form

Posted: Wed Nov 05, 2008 4:49 pm
by JAB Creations
tasairis, are you suggesting running the same function twice?

tonyledenko, have you tried using either the BCC or CC fields? Also email, email, email format in top field?

Re: how recepient to contact form

Posted: Wed Nov 05, 2008 6:19 pm
by infolock
tonyledenko wrote:Hello,

How can I send the form results to the person who fills it out. Currently, I am having it sent to me.

//The email address the message will be sent to
$youremail = "ttttt@ttttt.com";

<?

//Checks to see if the name field is empty. You can delete or add fields as needed.

if ( (!empty($name)))
{

$name = stripslashes($name);
$message = stripslashes($message);
//This is where the email is sent using your values from above.
mail("$youremail", "$subject","$thetext");
?>

First of all, you don't need the double quotes (") around the $youremail, $subject, $thetext in the mail function.

Secondly, not sure what the issue is with your code. are you getting errors of some sort? It looks fine to me (execpt your using $thetext instead of $message...)

Re: how recepient to contact form

Posted: Wed Nov 05, 2008 7:05 pm
by requinix
JAB Creations wrote:tasairis, are you suggesting running the same function twice?
In so many words, yes. He said that "currently" it was sending the emails to him so he already has something working.
If he wants a copy of the email sent to another person, duplicating the mail() statement after changing the To address should be enough.

Re: how recepient to contact form

Posted: Wed Nov 05, 2008 9:53 pm
by infolock
Actually, he doesn't need to do that. he could just add CC to the headers... which would make it only one function call instead of 2.

example:

Code: Select all

 
mail("bob@bob.com","subject", "a message", "CC:someone@bob.com");
 
//or, for BCC
 
mail("bob@bob.com","subject", "a message", "BCC:someone@bob.com");
 
// or, for both CC and FROM
 
mail("bob@bob.com","subject", "a message", "From:webmaster@bob.com\r\nCC:someone@bob.com\r\n");