php mail duplicates

前端 未结 4 754
[愿得一人]
[愿得一人] 2021-01-07 02:06

Is there any reason why this would send duplicate emails? I have a PHP page with only this code on it and every time I run it it sends me two emails.



        
4条回答
  •  广开言路
    2021-01-07 02:32

    Maybe your page loads twice, therefore executes the code two times...You could try some limitation, something like that

    if ($sent == '0') {
      mail("abc@def.ghi", "test", "test");
      $sent = 1;
    } 
    

    Is this a simple php page, or part of a CMS? Maybe some modules might interfere with your page...

提交回复
热议问题