/    Sign up×
Community /Pin to ProfileBookmark

Email HTML With Multiple Email Receipents

The below code is an example of what will be emailed to my clients.

The previous page will be a simple form with one field called “email_list”.
I’m going to input multiple email addresses seperated by an “;” ([email protected]; [email][email protected][/email]; [email][email protected][/email])

Here is the part where i’m totally lost, when they hit submit, how can I tell the code below to send this to every email receipent in an array/loop until its finished, after display a message, “All Emails Have Been Sent”?

Thanks for you help!

[code=php]
<?php

$to = “$email_list”;
$subject = “E-Newsletter”;
$headers = “To: $email_list <$email_list>rn”;
$headers = “From: Company <[email protected]>rn”;
$headers .= “MIME-Version: 1.0rn”;
$headers .= “Content-Type: text/html; charset=ISO-8859-1rn”;
$message = “<html>n”;
$message .= “<head>n”;
$message .= “<title>Test</title>n”;
$message .= “</head>n”;
$message .= “<body>n”;
$message .= “</body>n”;
$message .= “</html>n”;

mail($to, $subject, $message, $headers);

?>
[/code]

to post a comment
PHP

0Be the first to comment 😎

×

Success!

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