/    Sign up×
Community /Pin to ProfileBookmark

send form info to 2 emails

here is the php

[code=php]<?PHP
$to = “[email protected]”;
$subject = “Results from your Request Info form”;
$headers = “From: page”;
$forward = 1;
$location = “http://mypage.php”;

$date = date (“l, F jS, Y”);
$time = date (“h:i A”);

$msg = “Below is the result of your feedback form. It was submitted on $date at $time.nn”;

if ($_SERVER[‘REQUEST_METHOD’] == “POST”) {
foreach ($_POST as $key => $value) {
$msg .= ucfirst ($key) .” : “. $value . “n”;
}
}
else {
foreach ($_GET as $key => $value) {
$msg .= ucfirst ($key) .” : “. $value . “n”;
}
}

mail($to, $subject, $msg, $headers);
if ($forward == 1) {
header (“Location:$location”);
}
else {
echo “Thank you for submitting our form. We will get back to you as soon as possible.”;
}

?> [/code]

how do i send that to 2 people

i tried to add another $to = “[email protected]“; but it did not work

please help

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@pierskJan 30.2004 — Why not send a carbon copy (i.e. CC)?

In the headers, add
[code=php]$headers .= "cc: [email][email protected][/email]rn";[/code]

(and don't forget to add "rn" after the from bit.
Copy linkTweet thisAlerts:
@chris9902authorJan 30.2004 — thank you
×

Success!

Help @chris9902 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...