To enable the mail function through Cpanel.
Log in to Cpanel --> Multi PHP INI editor --> Editor Mode --> Choose Home Directory --> add the below command in the last line and save:
disable_functions = show_source, system, shell_exec, passthru, exec, popen, proc_open, symlink
NOTE: That is the functions not added to disable_functions = are enabled.