It only sends email to the first email address. The second email address does not work because it is a variable. What do you think?
$to = "email1@gmail.com,". $rs['email2'];
$subject = "Hello";
$from = "admin@itservice.com";
$headers = "From: $from
";
$headers .= "MIME-Version: 1.0
"
."Content-Type: multipart/mixed; boundary=\"1a2a3a\"";
$message .= "This is a message..."
."--1a2a3a
";
$file = file_get_contents("memomemomemo4.pdf");
// Send email
$success = mail($to,$subject,$message,$headers);
Try this syntax instead:
$to = "email1@gmail.com,".$rs['email2'];
Why not:
$rs['email2'] = "me@me.com";
echo "email1@gmail.com,{$rs['email2']}";
# email1@gmail.com,me@me.com