Definition and usage
The mail () function allows you to send emails directly from scripts.
This function returns TRUE if the email has successfully accepted delivery; otherwise, FALSE.
Syntax
Mail (to, subject, message, headers, parameters)
To |
Recipient |
Subject |
Title |
Message |
Content <? Php $ Txt = str_replace ("n.", "n ..", $ txt ); ?> |
Headers |
Optional. Specify an additional title, from, copy, and BCC copy. The additional title should be a separate CRLF (r n) segment. Note: when sending an email, it must contain a header. This can be set or in the php. Ini file.
|
Parameters |
Optional. Specify an additional parameter email program (a defined sendmail_path configuration setting ). (That is, the port mail option that can be used to set the mail address of the envelope sender)
|
Tips and instructions
Note: Keep in mind that the email is delivered only because it is accepted, but this does not mean that the email is actually sent and received.
Example 1
Send a simple email:
$ Txt = "First line of textnSecond line of text ";
// Use wordwrap () if lines are longer than 70 characters $ txt = wordwrap ($ txt, 70 );
// Send emailmail ("somebody@example.com", "My subject", $ txt );