Skip to content
PHP Logo

What settings in php.ini are required to send emails from a local server?

To send emails from a local server using PHP, you need to configure the SMTP settings in the php.ini file. Specifically, you need to set the `SMTP` and `smtp_port` parameters to the appropriate values of your email provider. Additionally, you may need to set the `sendmail_path` parameter to specify the path to the sendmail program on your server.

php
[mail function]
SMTP = smtp.example.com
smtp_port = 25
sendmail_path = /usr/sbin/sendmail