0% found this document useful (0 votes)
66 views

PHP Mail Functions

The document discusses PHP mail functions. It provides an introduction to the mail() function which allows sending emails directly from scripts. It notes requirements for the mail functions to be available and that the functions are part of the PHP core with no installation needed. It also describes runtime configuration settings in php.ini that affect mail function behavior like SMTP server settings.

Uploaded by

Thant Thant
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views

PHP Mail Functions

The document discusses PHP mail functions. It provides an introduction to the mail() function which allows sending emails directly from scripts. It notes requirements for the mail functions to be available and that the functions are part of the PHP core with no installation needed. It also describes runtime configuration settings in php.ini that affect mail function behavior like SMTP server settings.

Uploaded by

Thant Thant
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

w3schools.

com LOG IN

  HTML CSS MORE  EXERCISES   

PHP Mail Functions


❮ Previous Next ❯

PHP Mail Introduction


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 working email system. The
program to be used is defined by the configuration settings in the php.ini file.

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

Runtime Configuration
The behavior of the mail functions is affected by settings in php.ini:

Name Default Description Changeable

mail.add_x_header "0" Add X-PHP-Originating-Script PHP_INI_PERDIR


that will include UID of the
script followed by the
filename. For PHP 5.3.0 and
above

mail.log NULL The path to a log file that will PHP_INI_PERDIR


log all mail() calls. Log 
include full path of script, line
number, To address and
headers. For PHP 5.3.0 and
above

SMTP "localhost" Windows only: The DNS PHP_INI_ALL


name or IP address of the
SMTP server

smtp_port "25" Windows only: The SMTP PHP_INI_ALL


port number. For PHP 4.3.0
and above

sendmail_from NULL Windows only: Specifies the PHP_INI_ALL


"from" address to be used
when sending mail from
mail()

sendmail_path "/usr/sbin/sendmail Specifies where the sendmail PHP_INI_SYSTEM


-t -i" program can be found. This
directive works also under
Windows. If set, SMTP,
smtp_port and
sendmail_from are ignored

PHP Mail Functions


Function Description

ezmlm_hash() Calculates the hash value needed by EZMLM

mail() Allows you to send emails directly from a script

❮ Previous Next ❯

You might also like