Recently made a news system, in order to imitate the major website of the online letter function to write this small program, I hope the rookie brother useful.
I did not give a part of the code, only the key parts. where Shouxin on behalf of the recipient's 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. The ID is the parameter passed in front of you, it is useless to you at all.
if ($shouxin = = "")
{
echo "No recipient's address, cannot be sent out";
}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 "sent successfully! ";
}else{
echo "Send failed, please resend." ";
Exit ();}
}
}
?>
http://www.bkjia.com/PHPjc/315666.html www.bkjia.com true http://www.bkjia.com/PHPjc/315666.html techarticle recently made a news system, in order to imitate the major website of the online letter function to write this small program, I hope the rookie brother useful. I did not give a part of the code, just give off ...