将邮件发送到每个数组值

I have an array $emails. The print_r($emails) output following:

Array
(
    [0] => Array
        (
            [user_email] => 
        )

    [1] => Array
        (
            [user_email] => mail_1@gmail.com
        )

    [2] => Array
        (
            [user_email] => mail_2@gmail.com
        )
)

Now I want to send emails to all email addresses in this array. I tried:

foreach($emails as $contact) {

$to      =  $contact;
$subject = 'the subject';
$message = 'hello';
mail($to, $subject, $message, $headers);

}

What I get is: Warning: mail() expects parameter 1 to be string, array given

foreach($emails as $contact) {

$to      =  $contact['user_email'];
$subject = 'the subject';
$message = 'hello';
mail($to, $subject, $message, $headers);

}