<HTML ><HEAD ><TITLE >Mail functions</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK REL="HOME" TITLE="PHP Manual" HREF="index.html"><LINK REL="UP" TITLE="Function Reference" HREF="funcref.html"><LINK REL="PREVIOUS" TITLE="ldap_unbind" HREF="function.ldap-unbind.html"><LINK REL="NEXT" TITLE="ezmlm_hash" HREF="function.ezmlm-hash.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=ISO-8859-1"></HEAD ><BODY CLASS="reference" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >PHP Manual</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="function.ldap-unbind.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.ezmlm-hash.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="reference" ><A NAME="ref.mail" ></A ><DIV CLASS="TITLEPAGE" ><H1 CLASS="title" >XLIX. Mail functions</H1 ><DIV CLASS="PARTINTRO" ><A NAME="AEN43744" ></A ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="mail.intro" ></A >Introduction</H1 ><P > The <A HREF="function.mail.html" ><B CLASS="function" >mail()</B ></A > function allows you to send mail. </P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="mail.requirements" ></A >Requirements</H1 ><P >No external libraries are needed to build this extension.</P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="mail.installation" ></A >Installation</H1 ><P >There is no installation needed to use these functions; they are part of the PHP core.</P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="mail.configuration" ></A >Runtime Configuration</H1 ><P > The behaviour of these functions is affected by settings in <TT CLASS="filename" >php.ini</TT >. </P ><P > <DIV CLASS="table" ><A NAME="AEN43760" ></A ><P ><B >Table 1. Mail configuration options</B ></P ><TABLE BORDER="1" CLASS="CALSTABLE" ><THEAD ><TR ><TH ALIGN="LEFT" VALIGN="MIDDLE" >Name</TH ><TH ALIGN="LEFT" VALIGN="MIDDLE" >Default</TH ><TH ALIGN="LEFT" VALIGN="MIDDLE" >Changeable</TH ></TR ></THEAD ><TBODY ><TR ><TD ALIGN="LEFT" VALIGN="MIDDLE" >SMTP</TD ><TD ALIGN="LEFT" VALIGN="MIDDLE" >"localhost"</TD ><TD ALIGN="LEFT" VALIGN="MIDDLE" >PHP_INI_ALL</TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="MIDDLE" >smtp_port</TD ><TD ALIGN="LEFT" VALIGN="MIDDLE" >"25"</TD ><TD ALIGN="LEFT" VALIGN="MIDDLE" >PHP_INI_ALL</TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="MIDDLE" >sendmail_from</TD ><TD ALIGN="LEFT" VALIGN="MIDDLE" >NULL</TD ><TD ALIGN="LEFT" VALIGN="MIDDLE" >PHP_INI_ALL</TD ></TR ><TR ><TD ALIGN="LEFT" VALIGN="MIDDLE" >sendmail_path</TD ><TD ALIGN="LEFT" VALIGN="MIDDLE" >DEFAULT_SENDMAIL_PATH</TD ><TD ALIGN="LEFT" VALIGN="MIDDLE" >PHP_INI_SYSTEM</TD ></TR ></TBODY ></TABLE ></DIV > For further details and definition of the PHP_INI_* constants see <A HREF="function.ini-set.html" ><B CLASS="function" >ini_set()</B ></A >. </P ><P > Here is a short explanation of the configuration directives. <P ></P ><DIV CLASS="variablelist" ><DL ><DT ><A NAME="ini.smtp" ></A ><TT CLASS="parameter" ><I >SMTP</I ></TT > <A HREF="language.types.string.html" ><B CLASS="type" >string</B ></A ></DT ><DD ><P > Used under Windows only: DNS name or IP address of the SMTP server PHP should use for mail sent with the <A HREF="function.mail.html" ><B CLASS="function" >mail()</B ></A > function. </P ></DD ><DT ><A NAME="ini.smtp-port" ></A ><TT CLASS="parameter" ><I >SMTP</I ></TT > <A HREF="language.types.integer.html" ><B CLASS="type" >int</B ></A ></DT ><DD ><P > Used under Windows only: Number of the port to connect to the server specified with the <TT CLASS="literal" >SMTP</TT > setting when sending mail with <A HREF="function.mail.html" ><B CLASS="function" >mail()</B ></A >; defaults to 25. Only available since <TT CLASS="literal" >PHP</TT > 4.3.0. </P ></DD ><DT ><A NAME="ini.sendmail-from" ></A ><TT CLASS="parameter" ><I >sendmail_from</I ></TT > <A HREF="language.types.string.html" ><B CLASS="type" >string</B ></A ></DT ><DD ><P > Which "From:" mail address should be used in mail sent from PHP under Windows. </P ></DD ><DT ><A NAME="ini.sendmail-path" ></A ><TT CLASS="parameter" ><I >sendmail_path</I ></TT > <A HREF="language.types.string.html" ><B CLASS="type" >string</B ></A ></DT ><DD ><P > Where the <B CLASS="command" >sendmail</B > program can be found, usually <TT CLASS="filename" >/usr/sbin/sendmail</TT > or <TT CLASS="filename" >/usr/lib/sendmail</TT >. <B CLASS="command" >configure</B > does an honest attempt of locating this one for you and set a default, but if it fails, you can set it here. </P ><P > Systems not using sendmail should set this directive to the sendmail wrapper/replacement their mail system offers, if any. For example, <A HREF="http://www.qmail.org/" TARGET="_top" >Qmail</A > users can normally set it to <TT CLASS="filename" >/var/qmail/bin/sendmail</TT > or <TT CLASS="filename" > /var/qmail/bin/qmail-inject</TT >. </P ><P > <B CLASS="command" >qmail-inject</B > does not require any option to process mail correctly. </P ></DD ></DL ></DIV > </P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="mail.resources" ></A >Resource Types</H1 ><P >This extension has no resource types defined.</P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="mail.constants" ></A >Predefined Constants</H1 ><P >This extension has no constants defined.</P ></DIV ></DIV ><DIV CLASS="TOC" ><DL ><DT ><B >Table of Contents</B ></DT ><DT ><A HREF="function.ezmlm-hash.html" >ezmlm_hash</A > -- Calculate the hash value needed by EZMLM</DT ><DT ><A HREF="function.mail.html" >mail</A > -- send mail</DT ></DL ></DIV ></DIV ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="function.ldap-unbind.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.ezmlm-hash.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >ldap_unbind</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="funcref.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >ezmlm_hash</TD ></TR ></TABLE ></DIV ></BODY ></HTML >