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!
Hello,
I need to be able to have form details sent to additional email addresses. How can I do this? I tried "$mailcc =" but it didn't work for me.
Thanks,
Al
<script language="php">
$email = $HTTP_POST_VARS[email];
$mailto = "joe@yahoo.com";
$mailsubj = "Website Form Submission";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "This is the information that a web visitor entered into a form on the website.:\n";
while (list ($key, $val) = each ($HTTP_POST_VARS)) { $mailbody .= "$key : $val\n"; }
if (!eregi("\n",$HTTP_POST_VARS[email])) { mail($mailto, $mailsubj, $mailbody, $mailhead); }
print "<meta http-equiv=\"refresh\" content=\"0;URL=http://www.yahoo.com/thanks.html\">";
</script>
alsoto wrote:I tried "$mailcc =" but it didn't work for me.
What exactly does this mean. Have you tried adding a 'Cc: someone@wherever.com' to the header? Have you tried using a comma-separated list of recipients?
<script language="php">
$email = $HTTP_POST_VARS[email];
$mailto = "joe@yahoo.com";
$mailcc = "bob@yahoo.com";
$mailsubj = "Website Form Submission";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "This is the information that a web visitor entered into a form on the website.:\n";
while (list ($key, $val) = each ($HTTP_POST_VARS)) { $mailbody .= "$key : $val\n"; }
if (!eregi("\n",$HTTP_POST_VARS[email])) { mail($mailto, $mailcc, $mailsubj, $mailbody, $mailhead); }
print "<meta http-equiv=\"refresh\" content=\"0;URL=http://www.yahoo.com/thanks.html\">";
</script>
alsoto wrote:Hello,
I need to be able to have form details sent to additional email addresses. How can I do this? I tried "$mailcc =" but it didn't work for me.
Thanks,
Al
<script language="php">
$email = $HTTP_POST_VARS[email];
$mailto = "joe@yahoo.com";
$mailsubj = "Website Form Submission";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "This is the information that a web visitor entered into a form on the website.:\n";
while (list ($key, $val) = each ($HTTP_POST_VARS)) { $mailbody .= "$key : $val\n"; }
if (!eregi("\n",$HTTP_POST_VARS[email])) { mail($mailto, $mailsubj, $mailbody, $mailhead); }
print "<meta http-equiv=\"refresh\" content=\"0;URL=http://www.yahoo.com/thanks.html\">";
</script>