/    Sign up×
Community /Pin to ProfileBookmark

PHP mail() to different addy, user selects radio button

hi all

could some one tell me how to get php to send a form to a different email address depending on what the user selects, for this i have 3 radio buttons lets say

Email Top
o Feedback
o Complaint
o Other

Form contents….

Send

if feedback selected goes to [email][email protected][/email], complaint; [email][email protected][/email] and other [email][email protected][/email]

Thanks alot
Hope you understand what i am after, a complete code, link, ideas anything would be appreciated greatly

RR

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@WebfreakMar 23.2004 — Here is a script: [code=php]<?php
$mail1 = "[email protected]"; // set mail for Feedback
$mail2 = "[email protected]"; // set mail for Complaint
$mail3 = "[email protected]";// set mail for Other

$subject = "Subject"; // set subject of a message
$message = "Message"; //set message of the mail
if (isset($_POST['1'])) {
mail($mail1, $subject, $message);
}

if (isset($_POST['2'])) {
mail($mail2, $subject, $message);
}

if (isset($_POST['3'])) {
mail($mail1, $subject, $message);
}
?>[/code]


Just name the radiobuttons 1, 2, 3.

I hope it works. ?
×

Success!

Help @richiet85 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.19,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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