Problem:
PHP does not like you to put array statements between quotes.
instead of
$to = "$address[$i]";
try
$to = $address[$i];
The quotes are not required here anyway, because you are not including any normal text.
if you wanted to add normal text to your $to variable you should use the concatenation sign, a dot, to paste the two together like this:
$new_line = "Hello, I am sending this message to ".$address[$i]." and I like it";