Link to home
Start Free TrialLog in
Avatar of skylabel
skylabel

asked on

php mailer not sending to all addresses

Hi, I need some urgent help. My client is getting quite upset...I've got the following code to send an email to multiple addressses. For some reason, it's only sending to the first AddAddress.....although I can see all the to addresses when $email receicves the mail in the to box...
I swear I tested this out b4, but now it doesn't work...please can anyone tell me why?

$mail = new PHPMailer();
$mail->From = "sender@sender.com";
$mail->FromName = "your friend sender";
$mail->AddAddress('$email', '$contactname');
$mail->AddAddress('me@me.com', 'Phil');
$mail->AddReplyTo("sender@sender.com");
$mail->Subject = "Ball Registration";
$mail->IsHtml(true);
$mail->Body = $emailcontent;
$mail->AltBody = "you email client is HTML disabled";
if(!$mail->Send()) {
     echo "Message was not sent";
     echo "Mailer Error: " . $mail->ErrorInfo;
}

else {
    header('Location: http://www.casbaaconvention.com/success.html');
}
Avatar of minichicken
minichicken

Maybe in your PHPMailer class, disable email address validation and see.

j311y :)
ASKER CERTIFIED SOLUTION
Avatar of jdpipe
jdpipe
Flag of Australia image

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
SOLUTION
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
You could also try sending the additional mails as a carbon copy, or a blind carbon copy, eg:

$mail->AddCC('me@me.com', 'Phil');

or

$mail->AddBCC('me@me.com', 'Phil');

These are both limited to win32 though.
SOLUTION
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
SOLUTION
Avatar of Giovanni G
Giovanni G
Flag of Italy image

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