Recently to do a news system, in order to imitate the major web site of the online letter to write the function of this small program, I hope that the rookie brother useful.
I didn't give a part of the code, just give the key part. Shouxin on behalf of the addressee address, Shouren on behalf of the recipient's name, Jixin on behalf of the sender's address, Faren on behalf of the sender's name. IDs are the parameters that come in front of you, and it's no use to you.
?
if ($shouxin = = "")
{
echo "has no recipient's address and cannot be mailed";
}else{
$to =explode (', ', $shouxin);
$tocount =count ($to);
$headers = "From:". $jixin. " n ";
$subject = "Receiving letter";
$body = "Hello." $shouren ";
$body. = "n";
$body. = "Your friend $faren";
$body. = "Recommend you to give you an article http://127.0.01.1/myweb/biye/news/newsdetail.php?id= $id";
$body. = "n";
$body. = "$content";
for ($i =0; $i < $tocount; $i + +) {
if (Mail ($to [$i], $subject, $body, $headers))
{
echo "Send success!" ";
}else{
Echo sent failed, please resend. ";
Exit ();}
}
}
?>
Turn from: Dynamic Network production guide www.knowsky.com
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.