top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

PHP: How to disable mail from my hosting?

+3 votes
641 views

I need disable using of any mail command from my hosting, so I'm not sure if is sufficiently put "mail" to disable_functions in php.ini:

disable_functions = mail

I want force obligatorily use of smtp authentication, Is it enough disable "mail"? or do I need add other command to disable_functions?

i.e.: using joomla I see: phpmail and sendmail

posted Feb 19, 2014 by Satish Mishra

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Disabling mail() method will not allow anyone to use the mail() method on php. Sendmail on the other hand is what mail() uses to send out the emails (depending on the configs). Users (depending on what other functions you have disabled) can directly execute sendmail program.

You can either block all exec style php functions, disable sendmail (by setting permissions to root) or removing it altogether.

Exec functions are (I might have forgot one, someone can add to it): exec, passthru, shell_exec, system, proc_open, popen, curl_exec, curl_multi_exec, popen

(This is assuming you don't have a sendmail alternative installed.)

answer Feb 19, 2014 by Sheetal Chauhan
Similar Questions
+4 votes

Question related to a internal company knowledge transfer site. Suppose there is a tag like PHP and I want to send mail to the PHP followers when a new question is posted in PHP tag?

Can i get any logic for it ?

+1 vote

I have used the - mail() — Send mail php function to send email from a site. Now it seems the server is blocking this for safety because I should be using authentication....

Q: mail() does not have authentication - correct?
Q: So I read from the link below that maybe I should use - PEAR Mail package .... is this a good choice to send mail with authentication?

...any suggestions for basic sending email with authentication (setup info and links also) would be welcome.

0 votes

I'm using the class.phpmailer.php code to send email -- it works neat. I can send an email from my domain and it arrives almost immediately.

However, when I use the exact same code (except for the FROM address) from another domain I own, the email literally takes hours (up to 12) to arrive.

Any idea of why there is a difference of email transit times between the two domains?

0 votes

My yahoo mailbox has more then 10K unread mail, and it seems to be full. I want to delete all emails in one go. How can I achieve that?

...