Home > Backend Development > PHP Tutorial > About that SMTP class and an example_PHP tutorial

About that SMTP class and an example_PHP tutorial

WBOY
Release: 2016-07-20 11:03:42
Original
831 people have browsed it

Due to display reasons, some spaces in the posted posts have been deleted, causing some errors in usage.
The analysis is as follows:
1. Due to inadvertent modifications, after everyone gets such an excellent class, they always hope to change it to look more comfortable. However, I need to remind you that in this program, sometimes adding or deleting a few spaces will cause program errors.
2. Now I will explain some problems with the program I posted.
Content-Type: There must be several spaces in front of the following 1-2 lines. Please add. The spaces in front of each line in the HTML will not be displayed, so they are not included in the post.
This is what a friend posted earlier. I modified it 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 is an example:
It’s actually very simple.
$sender= new smtp();
$fromname="sony";
$frommail="sonymusic@china.com";
$toname="pbabi";
$tomail ="panbei@163.net";
$subject="An example";
$text_body="Please use an email software that supports HTML format to view this email";
$html_body.="< ;html>

Example

";
$send_ok=$sender->send ($fromname,$toname,$frommail,$tomail,$subject,$text_body,$html_body);


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/445268.htmlTechArticleDue to display reasons, some spaces in the posted posts have been deleted, causing some problems for everyone. mistake. The analysis is as follows: 1. Because of inadvertent modifications, everyone got this...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template