mailSend mailDescriptionboolmailstringtostringsubjectstringmessagestringadditional_headersstringadditional_parametersmail automatically mails the message
specified in message to the receiver
specified in to. Multiple recipients can
be specified by putting a comma between each address in
to. Email with attachments and special
types of content can be sent using this function. This is
accomplished via MIME-encoding - for more information, see this
Zend article or the
PEAR Mime Classes.
The following RFC's may also be useful:
RFC 1896,
RFC 2045,
RFC 2046,
RFC 2047,
RFC 2048, and
RFC 2049.
mail returns &true; if the mail was successfully
accepted for delivery, &false; otherwise.
The Windows implementation of mail differs in many
ways from the Unix implementation. First, it doesn't use a local binary
for composing messages but only operates on direct sockets which means a
MTA is needed listening on a network socket (which
can either on the localhost or a remote machine). Second, the custom
headers like From:, Cc:,
Bcc: and Date: are not interpreted by the MTA
in the first place, but are parsed by PHP.
PHP < 4.3 only supported the Cc:
header element (and was case-sensitive). PHP >= 4.3
supports all the mentioned header elements and is no longer
case-sensitive.
Sending mail.
]]>
If a fourth string argument is passed, this string is inserted at
the end of the header. This is typically used to add extra
headers. Multiple extra headers are separated with a carriage return
and newline.
You must use \r\n to separate headers, although
some Unix mail transfer agents replace \n by
\r\n automatically (leads to doubling
\r if \r\n is used).
Sending mail with extra headers.
]]>
The additional_parameters parameter
can be used to pass an additional parameter to the program configured
to use when sending mail using the sendmail_path
configuration setting. For example, this can be used to set the
envelope sender address when using sendmail with the
-f sendmail option. You may need to add
the user that your web server runs as to your sendmail configuration
to prevent a 'X-Warning' header from being added to the message when
you set the envelope sender using this method.
Sending mail with extra headers and setting an additional command line parameter.
]]>
This fifth parameter was added in PHP 4.0.5. Since PHP 4.2.3 this
parameter is disabled in safe_mode
and the mail function will expose a warning message
and return &false; if you're trying to use it.
You can also use simple string building techniques to build complex
email messages.
Sending complex email.Birthday Reminders for August