[thelist] [php] emailing to multiple recipients

sandra sandra.miller1969 at ntlworld.com
Wed Jun 9 19:03:18 CDT 2004


You can change $recipient to a comma separated list
of email addresses:
http://us2.php.net/manual/en/function.mail.php


/Carl

Unless you have to, there is a much more elegant way of doing this that
avoids having to deal with code.

Any good ISP should have alias support, so that you can have an email come
into the system for one address and then go out to as many recepients as you
have set up.  That way, you don't have to hack it into the php script...

Check it out:
http://www.google.com/search?hl=en&ie=UTF-8&q=email+alias&spell=1

Even if your ISP doesn't support it -- not problemo!  Just use a free
forwarding service.

Thanks both, I'll play with those and see what suits my nefarious purposes
best!

>  Hi,
>
>  I have a simple script on my site that sends mail to me. I
>  am looking to
>  hack the script so that it sends to as many as 15 recipients!
>
>  The script was downloaded from a website, the code is copied
>  below. Can
>  anyone help?
>
>  <?php
>
>  // headers for the email listed below
>
>  $headers .= "From: $name <$email>\n";  // your email client
>  will show the
>  person's email address like normal
>  $headers .= "Content-Type: text/plain;
>  charset=iso-8859-1\n"; // sets the
>  mime type
>  $recipient = "feedback at saveinverclyderoyal.com"; // enter
>  YOUR email address
>  here
>  $subject = "Feedback from Save IRH"; // this is the subject
>  of the email
>
>  $msg = wordwrap( $msg, 1024 );
>
>  mail($recipient, $subject, stripslashes($msg), $headers); //
>  the mail()
>  function sends the message to you
>
>  //Once the data is entered, redirect the user to give them visual
>  confirmation
>     header("location: thanks.php");
>  ?>
>
--
* * Please support the community that supports you.  * *
http://evolt.org/help_support_evolt/

For unsubscribe and other options, including the Tip Harvester
and archives of thelist go to: http://lists.evolt.org
Workers of the Web, evolt !


---
Mail Scanned with AVG Anti Virus http://www.grisoft.com/
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.701 / Virus Database: 458 - Release Date: 08/06/2004



More information about the thelist mailing list