Home >Backend Development >PHP Tutorial >用PHP实现用From发送电子邮件_PHP

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

WBOY
WBOYOriginal
2016-06-01 12:31:331053browse
  

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

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




Name:



E-Mail Address:



Website URL:





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


$contactemail = "you@yourdomain.com";
$subject = "You choose";
$message .= "Name: $name\n";
$message .= "E-mail: $email\n";
$message .= "Website URL: $url\n";
mail($contactemail, $subject, $message);
echo "Thanks for mailing me, I should reply with in a few
days."
?>

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