search
Homephp教程php手册谈谈PHP语法(5)

谈谈PHP语法(5)

Jun 13, 2016 pm 12:42 PM
emailmailphpthemecontentfunctionsendFormattextgrammar

正文:
  网上发送Email,可要用到mail()函数了。其格式如下:
  mail(收信人,主题,内容,邮件文件头);
  在网上,发送Email给站长,通常是这样的:webmaster@163.com 这样,当点击了webmaste崐r@163.com这个链接之后,就会启动默认的邮件编缉器来写Email,实在是麻烦,使用mail()函数,便可方便地编出一个在线发信页面。这种崐页面的收件人是固定的(webmaster@163.com),有需再填收件人地址了,而主题我们也可以将把它定下来。如下例:
  文件:email.html


发信给网管


网管收信








发件人:

主题:

内容:







文件:mail.php
if (empty($from) or empty($subject) or empty($content)) {echo "没有完成填写,请返回";}
$body="[主题] $subjectn";
$body.="[发件人] $fromn";
$body.=$content;
$deal=mail("webmaster@163.com",$subject,$body,"From:$from");
if ($deal) {echo "寄件成功!";}else{echo "寄件失败!!!";}
?>
  PHP介绍到此,也差不多了,你是不是感到了PHP的强大,是不是也想加入PHP的行列,就现在吧。要使自己在PHP中飞翔,这点知识还是崐不足的,它只能帮你入门而已。入门之后,就修行在个人了。我的朋友,再见──(^_^)
--(全文完)--
Statement
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools