Home > php教程 > php手册 > 用PHP实现用From发送电子邮件

用PHP实现用From发送电子邮件

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-25 16:49:37
Original
1332 people have browsed it

说明:用PHP实现发送电子邮件是比较简单的,大家可以看看如下完整代码。

1,把下面这段代码复制到你的网页中,可以复制到.HTML文件中。

<form action="mail.php" method="post"> 
<p align="center"> 
<font face="Verdana"> 
Name:<br> 
<input type="text" name="name" style="border: 1px solid #000000" style="font: Verdana" style="color: #000000" style="font-size: 8pt" style="background-color: #FFFFFF"><br> 
E-Mail Address:<br> 
<input type="text" name="email" style="border: 1px solid #000000" style="font: Verdana" style="color: #000000" style="font-size: 8pt" style="background-color: #FFFFFF"><Br> 
Website URL:<br> 
<input type="text" name="url" style="border: 1px solid #000000" style="font: Verdana" style="color: #000000" style="font-size: 8pt" style="background-color: #FFFFFF"><Br> 
<input type="submit" value="Submit" style="border: 1px solid #000000" style="font: Verdana" style="color: #000000" style="font-size: 8pt" style="background-color: #FFFFFF">
Copy after login

2,建立mail.php文件,并且和上面的保存在同一个目录中。

<?php 
$contactemail = "you@yourdomain.com"; 
$subject = "You choose"; 
$message .= "Name: $namen"; 
$message .= "E-mail: $emailn"; 
$message .= "Website URL: $urln"; 
mail($contactemail, $subject, $message); 
echo "Thanks for mailing me, I should reply with in a few 
days." 
?>
Copy after login


永久地址:

转载随意~请带上教程地址吧^^

Related labels:
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 Issues
ubuntu mongodb 出现 exception: connect failed
From 1970-01-01 08:00:00
0
0
0
An error occurred
From 1970-01-01 08:00:00
0
0
0
Why does clicking login jump to hello world?
From 1970-01-01 08:00:00
0
0
0
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template