PHP Mail
Introduction to PHP Mail
The mail() function allows you to send emails directly from a script.
Requirements
For the mail functions to be available, PHP requires an installed and running mail system. The program to use is defined by the configuration settings in the php.ini file.
Installation
The Mail function is an integral part of the PHP core. No installation is required to use these functions.
Runtime Configuration
The behavior of the Mail function is affected by settings in the php.ini file.
Mail configuration options:
Name | Default | Description | Can be changed |
---|---|---|---|
SMTP | "localhost" | Windows only: DNS name or IP address of the SMTP server. | PHP_INI_ALL |
smtp_port | "25" | Windows only: SMTP port number. Available since PHP 4.3. | PHP_INI_ALL |
sendmail_from | NULL | Windows only: Specifies the "from" to be used in emails sent by PHP address. | PHP_INI_ALL |
sendmail_path | NULL | Unix system-specific: specifies the path of the sendmail program (usually /usr/sbin/sendmail or /usr/lib/sendmail). | PHP_INI_SYSTEM |
##PHP Mail function
PHP: Indicates that the function is supported The earliest version of PHP.
Description | PHP | |
---|---|---|
Compute the hash value required by the EZMLM mailing list system. | 3 | |
Allows you to send an email directly from a script. | 3 |
PHP Mail Constants
None.