Super Simple e-mail program _php Tutorial

Source: Internet
Author: User
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 ...

  • 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.