E-mail confuguration in Php

Mail Configuration in Php

The mail() function allows you to send mails from a script directly

PHP requires an installed and working email system for the mail function to work well. It works by the configuration settings in the php.ini file.

The mail() functions is part of the PHP core. There is no installation needed to use these functions.

Configuration

we can set mail() function configurations in php.ini file with the directives as below.

Name Default Description
SMTP "localhost" (Windows) The DNS name or IP address of the SMTP server
smtp_port "25" (Windows) The SMTP port number.
sendmail_from NULL (Windows)Specifies the "from" address to be used in email sent from PHP
sendmail_path NULL (Linux): Specifies where the sendmail program can be found ( /usr/sbin/sendmail or /usr/lib/sendmail)

Php mail() Example

No comments: