Body:
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 an Email to the webmaster, typically like this: <a href = "mailto: webmaster@163.com"> webmaster@163.com </a> so that when you click the webmaste sites r@163.com link, the default mail editor will be started to write emails. This is really troublesome. You can easily compile an online mail page by using the mail () function. 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
<Html>
<Head>
<Title> send a mail to the network administrator </title>
</Head>
<Body>
<H2 align = "center"> network administrator reception <Hr> <br>
<Center>
<Form action = "mail. php">
Sender: <input type = "text" name = "from" size = 25> <br>
Topic: <input type = "text" name = "subject" size = 20> <br>
Content:
<Textarea name = "content" cols = 80 rows = 15> hello, Webmaster: </textarea> <br>
<Input type = "submit" value = "send"> <input type = "reset" value = "Rewrite"> <br>
</Form>
</Body>
File: mail. php
<? Php
If (empty ($ from) or empty ($ subject) or empty ($ content) {echo "is not completed, <a href = "email.html"> return </a> ";}
$ 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 )--