Hi All,
Trying to create a "refer a friend" script.
User enters 10 names and email address of a friend to refer to a site.
The following code SORT of works in that it will send the email, etc..
but problem is it duplicates - sends the email out twice to the same
email address.
foreach($nameRefered as $referedName) {
            foreach($emailRefered as $referedEmail) {
                        if ($referedEmail != "" && $referedName != "") {
                                    <message body here>
                                    /* To send HTML mail, you can set
the Content-type header. */
                                    $headers = "Return-Path:
                                    $headers .= "MIME-Version: 1.0\r\n";

                                    $headers .= "Content-type:
text/html; charset=iso-8859-1\r\n";
                                    $headers .= "From: $nameReferer
                                    mail ($referedEmail,"Your Order on
Rinkrake.com", $message, $headers);
Any thoughts on why I get the email twice?
Thanks all. Much appreciated!

Reply via email to