PHP Send message garbled specific solution _php Tutorial

Source: Internet
Author: User
We have described in some of the previous articles specifically

The following code is an example of a specific workaround for PHP to send garbled messages:

  1. < ? PHP
  2. #email. PHP 2009-11-04
  3. $ name = $_post[' name '];
  4. $ Mail = $_post[' mail '];
  5. $ content = $_post[' content '];
  6. $ subject = ' test-only ' ;
  7. $ subject = "=? UTF-8? B? " .
    Base64_encode ($subject). "? =";
  8. $ Body = "From: $mailn name:
    $namenn content: $content ";
  9. $headers = "Mime-version:1.0rn";
  10. $headers . = ' Content-type:
    text/html; Charset=utf-8 ' . "RN";
  11. $headers . = "content-
    Transfer-encoding:8bitrn ";
  12. If Mail (' * * * * * * @qq. com ',
    $subject, $body, $header)) {
  13. echo ' success ';
  14. }else{
  15. echo ' fail ';
  16. }
  17. ?>

Hope that the isomorphism of this code to understand, we can avoid PHP to send messages garbled this situation appears.


http://www.bkjia.com/PHPjc/446172.html www.bkjia.com true http://www.bkjia.com/PHPjc/446172.html techarticle we have in the previous articles specifically described in the following code is the PHP sent message garbled specific solution example:? PHP #email. php2009-11-04 $ name =$_post[' name '];

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