About that SMTP class and an example _php tutorial

Source: Internet
Author: User
Because of the reason for the display, there are some blank spaces in the post that have been removed, causing you to use some errors.
The analysis is as follows:
1, because inadvertently modified, we get such a very good class, always hope to change to look comfortable. But I need to remind you that in this program, sometimes adding or removing a few spaces can cause program errors.
2, now I will send up some questions about the program to explain.
Content-type: There are a few spaces in front of the 1-2 lines that follow. Please Add. The space in front of each line in the HTML is not displayed, so the post is not there.
This is a previous friend posted the content, I modified as follows:
This is a multi-part message in MIME format.
--=====_1__=====
content-type:multipart/alternative;
boundary= "=====_2__====="
--=====_2__=====
Content-type:text/plain;
charset= "GB2312"
Content-transfer-encoding:base64
x+vkudpd1qez1khutuwguphkvbxe08q8/sjtvp7atllpv7s4w9pkvp4=
--=====_2__=====
content-type:text/html;
charset= "GB2312"
Content-transfer-encoding:base64
pgh0bww+pghlywq+pc9ozwfkpjxib2r5pjxomt7a/dftpc9omt48l2jvzhk+pc9odg1spg==
--=====_2__=====--
--=====_1__=====--
Here's an example:
Actually, it's very simple.
$sender = new SMTP ();
$fromname = "Sony";
$frommail = "sonymusic@china.com";
$toname = "Pbabi";
$tomail = "Panbei@163.net";
$subject = "an example";
$text _body= "Please use HTML-enabled mail software to view this message";
$html _body.= "

Example

";
$send _ok= $sender->send ($fromname, $toname, $frommail, $tomail, $subject, $text _body, $html _body);


http://www.bkjia.com/PHPjc/445268.html www.bkjia.com true http://www.bkjia.com/PHPjc/445268.html techarticle because of the reason for the display, there are some blank spaces in the post that have been removed, causing you to use some errors. The analysis is as follows: 1, because of casual modification, we get this ...

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