|
Posted by Ted on 09/13/06 18:00
On Wed, 13 Sep 2006 11:55:47 GMT, Tha RagMan wrote...
>
>I have a little program that created the following PHP script to
>handle a basic form and email the results. What it doesn't do and I
>can't get it to do is send a separate email with inputted results data
>to another email address without it showing in the "To" header of
>either msgs. Alternately I would like for it to do a BCC. I have tried
>a number edits to the script but nothing so far has worked. Could
>someone with more PHP knowledge then I give me the lines of code that
>will accomplish either the separate email without displaying both
>email addys or BCC? I would be very appreciative if you could lend a
>helping hand with my problem.
>Many Thanks
>Tha RagMan
>
><?php
>@$rec_mailto = addslashes($_POST['rec_mailto']);
>@$rec_subject = addslashes($_POST['rec_subject']);
>@$rec_thanks = addslashes($_POST['rec_thanks']);
>@$Name = addslashes($_POST['Name']);
>@$Email = addslashes($_POST['Email']);
>@$Company = addslashes($_POST['Company']);
>@$Street = addslashes($_POST['Street']);
>@$City = addslashes($_POST['City']);
>@$State = addslashes($_POST['State']);
>@$Zip = addslashes($_POST['Zip']);
>@$Phone = addslashes($_POST['Phone']);
>@$Comments = addslashes($_POST['Comments']);
>
>// Validation
>//Sending Email to form owner
>$pfw_header = "From: $Email\n"
> . "Reply-To: $Email\n";
>$pfw_subject = "Response Form";
>$pfw_email_to = "me@myhost.com";
>$pfw_message = "rec_mailto: $rec_mailto\n"
>. "rec_subject: $rec_subject\n"
>. "rec_thanks: $rec_thanks\n"
>. "Name: $Name\n"
>. "Email: $Email\n"
>. "Company: $Company\n"
>. "Street: $Street\n"
>. "City: $City\n"
>. "State: $State\n"
>. "Zip: $Zip\n"
>. "Phone: $Phone\n"
>. "Comments: $Comments\n";
>@mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
>
> echo("<p align='center'><font face='Arial' size='3'
>color='#FF0000'>Thanks for your response ! ! !</font></p>");
>?>
>
If you don't have a variable setup for the Bcc mail header, maybe you can append
a line to one of the other headers, such as the "To" be starting with a newline
characters. As an example
$to_address .= "\n" . 'Bcc: hidden@addr.com, hidden2@addr.com';
On the other hand if you are writing PHP code an want to avoid someone using
your form to send out spam, you may want to check variables that can potentially
be used in the header to see if someone may be adding a Bcc header to your form
email.
Ted
--
Help a Community by Participating in Ours
We donate your subscription fees to the charity you choose
100% of your first month, 10% thereafter.
http://newsguy.com/charity.asp
Navigation:
[Reply to this message]
|