PHP Send mail code-with mail

Source: Internet
Author: User
Keywords Web Programming PHP Tutorials
Tags basic code content echo function html mail name

This is a free PHP tutorial to send mail code-oh, is the basic PHP itself upload function

<html>
<head>
<title> Letter to network management </title>
</head>
<body>
<H2 align= "Center" > Network Management Receipt </h2><br>
<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></html>

PHP code

<?php
if (empty ($from) or empty ($subject) or empty ($content)) {
 echo is not completed, please <a href= ' mail.html ' > Return </a> ";
}
$body = "[subject] $subjectn";
$body. = "[sender] $fromn";
$body. = $content;
$deal =mail ("guoanyuan@eyou.com", $subject, $body, "from: $from");
if ($deal) {echo sent successfully! ";} Else{echo "Send a piece of failure www.jzread.com!!! ";}

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.