PHP send email foreach - send to

前端 未结 2 1540
慢半拍i
慢半拍i 2021-01-29 09:52

I\'m using a script to send email to checked users (approval), but script is sending only to first checked user, here\'s the script:

if (isset($_POST[\'approve\'         


        
2条回答
  •  春和景丽
    2021-01-29 10:10

    You are defining your sendEmail() function inside your loop. The function is defined in the first iteration of your loop, in the second iteration the error is thrown (because the function already exists) and your script stops. Move the function definition it out of the loop.

    You should move ALL your function definitions out of the loop, a function can only be defined once.

提交回复
热议问题