PHP mail() not working in Cyberpanel

Domain

nameservers - ns1.name.com, ns2.name.com, ns3.name.com, ns4.name.com

DNS records in domain dns manager

example.com - A - 82.114.232.131
www.example.com - CNAME - example.com

VPS

Hostname - vps.example.com
Ubuntu 22.04 with Cyberpanel

Website:

https://www.example.com

CyberPanel:

https://example.com:8090

Logs β†’ Server Mail

Mailer - Default

Issue

PHP mail() not working | Postfix On

Kindly help me php mail() work

Note: I do not want to use SMTP

Thanks

Have you installed the modules required as they are not pre installed?

Here is the tutorial and see the comments i made in there as i was also installing php mail on ubuntu

1 Like

Hi, Thank you for your reply. I am using PHP 8.1 for which all 25 extensions are installed

Thanks

Php mail is not part of the 25 installable extensions within cyberpanel, you have to manually install it following the tutorial in the last post

1 Like

Hi,

Done following things on ssh

cd /usr/local/lsws/lsphp81/bin

wget Source of ', htmlspecialchars($_GET['viewsource']), '

./lsphp go-pear.phar

/usr/local/lsws/lsphp81/bin/pear install mail mail_mime mail_mimedecode

install ok: channel://pear.php.net/Mail-1.5.0
install ok: channel://pear.php.net/Mail_Mime-1.10.11
install ok: channel://pear.php.net/Mail_mimeDecode-1.5.6

systemctl restart lsws

php restarted from cyberpanel

But only previous 25 extensions still showing in cyberpanel php extensions install section

Thanks

Thats right, they do not show up as extensions in cyberpanel, you have to create an info.php file to check they have installed, also there is another command you have not run for the install, check the end part of the tutorial just below how to create the info.php