Php mail sends emails

Source: Internet
Author: User

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 );
 
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.