Why dosn't this php script work?

Are you receiving any errors? It should work like that however you could always change the headers to
Code:
"From: Test <[email protected]>"

Also make sure to check your spam folder as it may not be hitting the inbox
 
PHP:
foreach ($arr as $to)

Echo $to to make sure it is the actual array instead of the array key (which is by default a number). Weird, but sometimes I have to put
PHP:
foreach($arr[0] as $x)
in some of my scripts.

This is all determined by the way your arrays are generated (preg, explode, etc.).


Why are you using the reset function? Is that needed? Comment that out, echo $to, and re-execute the script. See what happens. The foreach command takes care of each array value.
 
Last edited:
Back
Top