Question

Hi there I was testing php code and was sending mails to my self coz the loop was in AJAX call so i didn't find better way to test it. now i am getting thousands of emails in my gmail.

Do anyone know how to force kill the sendemail process from terminal to stop this emails send by apache.

Was it helpful?

Solution

Killing sendmail will effect other applications and your server.

A better solution would be to disable the mail function (Assuming your sending emails using PHPs mail function) only for your application.

To disable the mail function just for your application you can do this.

   ini_set('disable_functions','mail'); //Place this in your PHP script
   php_value  disable_functions  mail //Or place this in your .htaccess file

To disable the mail function for all your applications you can place the following line in your php.ini.

disable_functions = "mail"

Also, note that doing this might throw an error or warning depending on your coding.

Hope this helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top