PHP syntax (5)

Source: Internet
Author: User
PHP syntax (5:
You can use the mail () function to send emails online. The format is as follows:
Mail (recipient, subject, content, mail file header );
On the Internet, send Email to the webmaster, usually this: webmaster@163.com like this, when you click the webmaste pull r@163.com this link, it will start the default mail editor to write e-mail, it is really troublesome. using the mail () function, you can easily compile an online mail page. The recipient of this sort page is fixed (webmaster@163.com), there is a need to fill in the recipient address, and the subject we can also set it down. For example:
File: email.html


Send emails to network administrators


Network management email receiving







File: mail. php
If (empty ($ from) or empty ($ subject) or empty ($ content) {echo "not completed, please return ";}
$ Body = "[Subject] $ subjectn ";
$ Body. = "[sender] $ fromn ";
$ Body. = $ content;
$ Deal = mail ("webmaster@163.com", $ subject, $ body, "From: $ from ");
If ($ deal) {echo "mail successful! ";} Else {echo" failed to send !!! ";}
?>
It's almost the same as PHP. do you feel the power of PHP and want to join the ranks of PHP. To make yourself fly in PHP, this knowledge is still insufficient. it can only help you get started. After getting started, you will practice yourself. Goodbye, my friend -- (^_^)
-- (Full text )--

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.