Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

PHP Mail function


May 11, 2021 PHP


Table of contents


PHP Mail function

PhP sends e-mail messages by using the mail() function.


Introduction to PHP Mail

The mail() function allows you to send e-mail directly from the script.


Demand

For mail functions to be available, PHP requires an installed and running messaging system. The program to use is defined .ini configuration settings in the php file.


Installation

The Mail function is part of the PHP core. These functions can be used without installation.


Runtime configuration

The behavior of the Mail function is affected .ini settings in the php file.

Mail configuration options:

name default describe Can change
SMTP "localhost" Windows dedicated: SMTP server DNS name or IP address. PHP_INI_ALL
smtp_port "25" Windows dedicated: SMTP port number.It is available from PHP 4.3. PHP_INI_ALL
sendmail_from NULL Windows dedicated: Specifies the "from" address used in emails sent by PHP. PHP_INI_ALL
sendmail_path NULL Unix system dedicated: Specify the path to the Sendmail program (usually / usr / sbin / sendmail or / usr / lib / sendmail). PHP_INI_SYSTEM


PHP Mail function

PHP: Indicates the earliest version of PHP that supports the function.

function describe PHP
ezmlm_hash() Calculate the hash value required for the EZMLM mailing list system. 3
mail() Allows you to send emails directly from the script. 3


PHP Mail constant

No.