Talk about PHP syntax (5)_PHP tutorial

WBOY
Release: 2016-07-21 16:06:34
Original
872 people have browsed it

Text:
To send email online, you need to use the mail() function. The format is as follows:
mail (recipient, subject, content, email file header);
On the Internet, sending an Email to the webmaster usually looks like this:webmaster@163.comIn this way, when you click on the link webmaster@163.com, the default email editor will be started to write emails. It is really troublesome. Use mail() function, you can easily program an online mailing page. The recipient of this kind of page is fixed (webmaster@163.com). You need to fill in the recipient address again, and we can also set the theme. For example:
File: email.html


Send an email to the network administrator



Network management reception








Sender:

Subject:

Content:




< /form>


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 "Shipment successful!";}else{echo "Shipment failed!";}
?>
PHP introduction Now, that's it. Have you felt the power of PHP and want to join the ranks of PHP? Just do it now. To make yourself fly in PHP, this knowledge is still not enough. It can only help you get started. After getting started, cultivation becomes personal. Goodbye, my friend──(^_^)
--(End of full text)--

www.bkjia.com true http: //www.bkjia.com/PHPjc/315389.html TechArticle Text: To send email online, you need to use the mail() function. The format is as follows: mail (recipient, subject, content, email header); On the Internet, sending an email to the webmaster usually looks like this:...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!