Link to home
Start Free TrialLog in
Avatar of missmuppet
missmuppet

asked on

PHP code not sending to both email addresses listed only one

Code in PHP form is sending form results to one email address only not both, the first recipient receives the email results the second name listed does not.

mail("emma@eventi.co.nz,emma@sfauckland.co.nz",
"#Delegate registration SFNZ National Conference 2007",
"This is an automated message:
Avatar of jentulman
jentulman

How many different email addresses have you used?
have you tried to use the successful email address twice?

e.g. "emma@eventi.co.nz, emma@eventi.co.nz"

it could be that the mail command isn't filling in absolutely all of the usual headers so this is increasing the score of the message in a spam filter somewhere.

If you send only to the second name, does it work?  If not, this is a problem with that email address, not your mail command.

Your mail command looks perfect, there is nothing wrong with it.
$rcpts = array(
"1" => "mymail@server.tld",
"2" => "myother@server.tpd");

foreach( $rcpts as $key => $value){
      mail($value, .... etc
}

regards,
ps this is a way to validate if all mail rcpts where succesfull... ie.

foreach( blaaa){
        if(mail(blaaa)){
                $successes[] = $value;
        }else{
                $failures[] = $value;
         }
}

regards,
ASKER CERTIFIED SOLUTION
Avatar of sakuya_su
sakuya_su

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial