/    Sign up×
Community /Pin to ProfileBookmark

Multi-mailto Checkbox form

I am trying to create a check box form that users can place a check next to the people they want to send an email to and when they click on submit it will populate their to field using there default email (most likely MSOutlook) allowing them to fill in the rest of the info such as the subject and content.

Any help to get me on the right track would be great…

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@NightShift58Feb 26.2007 — On the selection form, use:[code=php]
<input type='checkbox' name='email[]' value='Mail1'>Mail1
<input type='checkbox' name='email[]' value='Mail1'>Mail2
...
<input type='checkbox' name='email[]' value='Mailn'>Mailn[/code]
Important is the "[]" behind the variable name.

After that, in the processing/action page, you can test for checked boxes with:[code=php]
FOREACH ($_POST['email'] as $key => $thisMAIL) :
echo $thisMAIL . "is checked<br>";
ENDFOREACH;[/code]
Instead of echo, you can obviously use whatever instruction you need to build your mailing list.
×

Success!

Help @Doc 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.14,
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,
)...