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.c om', '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');
}
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'
$mail->AddAddress('me@me.c
$mail->AddReplyTo("sender@
$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');
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
$mail->AddCC('me@me.com', 'Phil');
or
$mail->AddBCC('me@me.com',
These are both limited to win32 though.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
j311y :)