Page 1 of 1

Contact Form Notification Script - Add Add'l Email $mailto's

Posted: Thu Jul 19, 2012 12:53 pm
by alsoto
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

Code: Select all

<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>

Re: Contact Form Notification Script - Add Add'l Email $mail

Posted: Thu Jul 19, 2012 2:34 pm
by Celauran
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?

mail()

Re: Contact Form Notification Script - Add Add'l Email $mail

Posted: Thu Jul 19, 2012 5:58 pm
by alsoto
I tried something like this with no success:

Code: Select all

<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>

Re: Contact Form Notification Script - Add Add'l Email $mail

Posted: Thu Jul 19, 2012 11:55 pm
by TildeHash
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

Code: Select all

<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>

Code: Select all

$mailhead = "From: $email\n\nReply-To: $email\n\nCc: $mailcc";
Maybe?

Re: Contact Form Notification Script - Add Add'l Email $mail

Posted: Fri Jul 20, 2012 5:14 am
by Celauran
alsoto wrote:I tried something like this with no success:
You need to look at the function signature. You cannot just randomly add parameters.