PHPMailer ( Biggest Spammer point )

How to disable PHPMailer sending functionality if email not authenticated like if no correct inbox, user name and password, No email will go out of server ?

In my honest opinion, if your users are spamming using mail() function, its time to suspend them unless your sites are hacked and hackers are using the function to send out spam emails.

But if you want to disable users from using mail(), you can do the following.

To simply disable mail() function in php you can edit your php.ini, then add the following line/ find the line:
disabled_functions = mail

Don’t forget to restart litespeed after.

Can we do this for at server level? So no need to do it in each domain accounts.

Thank you again for providing quick support.

You can do it for the global php.ini and it should be disabled for your users.

Just head to and edit the advanced php config there.

Thank you !!

@Numeriku Please confirm the last query, after this, user able to use SMTP with authentication to send mails if required in the application.

Above setting only disable unauthenticated mail from the server.

Yes they would have to use smtp to send mail.