A "Web page" location wouldn't help anyways, but to be sure it is understood. If in the exact place where you have the for loop, you instead assign the $email_array such that $email_array[0] has data, then it works the rest of the way through?

Do you do an assignment to $email_array to declare it before the for loop? Like:
Code:
 $email_array = array();
If the assignment of $email_array[0] related data is happening just before the processing of the email, then of course it will operate. The situation here is better "explained" by providing the code through which all this is processed or identifying things like where a function "group" exists if any, or that no function block exists between the two. Or, and going out on a limb, just before the email generation loop, like the line before, if you add global $email_array; might it fix the issue?