text:
To send email online, you need to use the mail() function. The format is as follows:
mail (recipient, subject, content, mail file header);
On the Internet, sending an email to the webmaster is usually like this: <a href="mailto:webmaster@">webmaster@</a> In this way, when you click the webmaste Newr@ link, the default email editor will be started to write the email. It is really troublesome. Using the mail() function, you can easily compile an online sending page. The recipients of this New Year page are fixed (webmaster@). If you need to fill in the recipient address, we can also set it down. As shown in the following example:
document:
<html>
<head>
<title>Send a message to the network administrator</title>
</head>
<body>
<h2 align="center">Network management receipt</h2><br>
<hr><br>
<center>
<form action="">
From: <input type="text" name="from" size=25><br>
Subject: <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></html>
document:
<?php
if (empty($from) or empty($subject) or empty($content)) {echo "Not completed, please <a href="">return</a>";}
$body="[theme] $subjectn";
$body.="[Sender] $from";
$body.=$content;
$deal=mail("webmaster@",$subject,$body,"From:$from");
if ($deal) {echo "Sent successfully!";}else{echo "Sent failed!!!";}
?>
That’s all, PHP is about the same. Do you feel the power of PHP and do you also want to join the ranks of PHP? Let’s do it now. To make yourself fly in PHP, this knowledge is still insufficient, it can only help you get started. After getting started, you will practice in your own hands. Goodbye, my friend──(^_^)
-(The full text is over--
To send email online, you need to use the mail() function. The format is as follows:
mail (recipient, subject, content, mail file header);
On the Internet, sending an email to the webmaster is usually like this: <a href="mailto:webmaster@">webmaster@</a> In this way, when you click the webmaste Newr@ link, the default email editor will be started to write the email. It is really troublesome. Using the mail() function, you can easily compile an online sending page. The recipients of this New Year page are fixed (webmaster@). If you need to fill in the recipient address, we can also set it down. As shown in the following example:
document:
<html>
<head>
<title>Send a message to the network administrator</title>
</head>
<body>
<h2 align="center">Network management receipt</h2><br>
<hr><br>
<center>
<form action="">
From: <input type="text" name="from" size=25><br>
Subject: <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></html>
document:
<?php
if (empty($from) or empty($subject) or empty($content)) {echo "Not completed, please <a href="">return</a>";}
$body="[theme] $subjectn";
$body.="[Sender] $from";
$body.=$content;
$deal=mail("webmaster@",$subject,$body,"From:$from");
if ($deal) {echo "Sent successfully!";}else{echo "Sent failed!!!";}
?>
That’s all, PHP is about the same. Do you feel the power of PHP and do you also want to join the ranks of PHP? Let’s do it now. To make yourself fly in PHP, this knowledge is still insufficient, it can only help you get started. After getting started, you will practice in your own hands. Goodbye, my friend──(^_^)
-(The full text is over--