关于那个SMTP类及一个例子
因为显示的原因,发上来的帖里里有一些空格被删除了,造成大家使用上的一些错误。
分析如下:
1,因为不经意的修改,大家拿到这样的很优秀的类后,总希望改成自己看起来舒心一些。不过我需要提醒一些,在这个程序里,有时增加或者删除几个空格都会造成程序出错。
2,现在我将发上来的程序的一些问题说说明一下。
Content-Type:后面的1-2行前面要有数个空格。请加上。HTML中每一行前面的空格都不会显示,所以,帖子里没有了。
这是前面一个朋友帖出的内容,我修改后如下:
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__=====--
这里有一个例子:
其实很简单的。
$sender= new smtp();
$fromname="sony";
$frommail="sonymusic@china.com";
$toname="pbabi";
$tomail="panbei@163.net";
$subject="一个例子";
$text_body="请使用支持HTML 格式的邮件软件来查看该邮件";
$html_body.="
例子
";$send_ok=$sender->send($fromname,$toname,$frommail,$tomail,$subject,$text_body,$html_body);

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

When connecting a printer to a local area network and starting a print job, some minor problems may occur. For example, the problem "wpsoffice cannot start the print job..." occasionally occurs, resulting in the inability to print out files, etc., delaying our work and study, and causing a bad impact. , let me tell you how to solve the problem that wpsoffice cannot start the print job? Of course, you can upgrade the software or upgrade the driver to solve the problem, but this will take you a long time. Below I will give you a solution that can be solved in minutes. First of all, I noticed that wpsoffice cannot start the print job, resulting in the inability to print. To solve this problem, we need to investigate one by one. Also, make sure the printer is powered on and connected. Generally, abnormal connection will cause

A Comprehensive Guide to PHP 500 Errors: Causes, Diagnosis, and Fixes During PHP development, we often encounter errors with HTTP status code 500. This error is usually called "500InternalServerError", which means that some unknown errors occurred while processing the request on the server side. In this article, we will explore the common causes of PHP500 errors, how to diagnose them, and how to fix them, and provide specific code examples for reference. Common causes of 1.500 errors 1.

Some users may encounter slow charging speeds when using Apple phones. There are many reasons for this problem. It may be caused by low power of the charging device, device failure, problems with the USB interface of the mobile phone, or even battery aging and other factors. Why does Apple mobile phone charge very slowly? Answer: charging equipment problem, mobile phone hardware problem, mobile phone system problem. 1. When users use charging equipment with relatively low power, the charging speed of the mobile phone will be very slow. 2. Using third-party inferior chargers or charging cables will also cause slow charging. 3. It is recommended that users use the official original charger, or replace it with a regular certified high-power charger. 4. There is a problem with the user’s mobile phone hardware. For example, the USB interface of the mobile phone cannot be contacted.

Explore the causes and solutions of HTTP status code 550 Introduction: In network communications, HTTP status codes play an important role and are used to indicate the results of the server processing the request. Among them, HTTP status code 550 is a relatively rare status code that is usually related to the server refusing to execute the request. This article will explore the causes of HTTP status code 550 and provide solutions. 1. The basic concept of HTTP status code. Before understanding the HTTP status code 550, let us first briefly understand the basic concept of HTTP status code.

Nowadays, in addition to data and wifi, mobile phones have two ways to access the Internet, and OPPO mobile phones are no exception. But what should we do if we can’t turn on the wifi function when using it? Don't worry yet, you might as well read this tutorial, it will help you! What should I do if my phone’s wifi function cannot be turned on? It may be because there is a slight delay when the WLAN switch is turned on. Please wait 2 seconds to see if it is turned on. Do not click continuously. 1. You can try to enter "Settings>WLAN" and try to turn on the WLAN switch again. 2. Please turn on/off airplane mode and try to turn on the WLAN switch again. 3. Restart the phone and try to see if WLAN can be turned on normally. 4. It is recommended to try restoring factory settings after backing up data. If none of the above methods solve your problem, please bring the purchased

The difference between full-width spaces and half-width spaces. When we use word processing software or edit text content, we sometimes encounter the concept of spaces. Space is a very basic element in typesetting and formatting text, but many people may not know the difference between full-width spaces and half-width spaces. In daily use, we may feel that full-width spaces and half-width spaces have different effects in different situations, but we may not be aware of the subtle differences. First of all, the difference between full-width spaces and half-width spaces is the width they occupy.

What happens when the desktop layout is locked? When using the computer, sometimes we may encounter the situation where the desktop layout is locked. This problem means that we cannot freely adjust the position of desktop icons or change the desktop background. So, what exactly is going on when it says that the desktop layout is locked? 1. Understand the desktop layout and locking functions. First, we need to understand the two concepts of desktop layout and desktop locking. Desktop layout refers to the arrangement of various elements on the desktop, including shortcuts, folders, widgets, etc. we can be free

Ctrip brings together a wide variety of resources such as flights, trains, hotels, attraction tickets, etc. to provide users with convenient and efficient booking services. When you encounter information that you don’t need, you can follow the editor’s tutorial to learn how to delete it and free up memory. Tutorial on how to delete common Ctrip travel information 1. Open the Ctrip Travel APP and make sure you are logged in to your account. 2. Find and click the [My] option in the navigation bar above or at the bottom of the main interface. 3. After entering the personal center, find the relevant entrances of [Common Information], [My Tools] or [Account Settings]. 4. In the [Common Information] page, browse and find the passenger information you want to delete. 5. Click the corresponding passenger name or the edit/delete button on the right (the icon may appear as an editing pen or a trash can icon). 6. After the confirmation dialog box pops up
