I read the source code of WordPress this afternoon and found two classes for sending mail -- PHPMailer and SMTP. WordPress uses PHPMailer to send new password when you lost your password. Moreover, PHPMailer supports multiple sending method, such as PHP function main(), Qmail, remote SMTP server or other "sendmail" programs. Especially SMTP server. So far, there are fewer and fewer anonymous SMTP servers on the Internet, most of them need authentication. SMTP class make these things simple and easy. When you let PHPMailer use remote SMTP server to send Email, PHPMailer will use SMTP to connect to the remote server to accomplish the task.
Now let's see how to use PHPMailer to send your Email.
Firstly, you need to copy class-phpmailer.php and class-smtp.php from wp-includes directory of WordPress to your working directory. Then make a new PHP file in your working directory to enter codes. See below:
// Let PHPMailer use remote SMTP Server to send Email
// Set the charactor set. The default is 'UTF-8'
// Add an recipients. You can add more recipients
// by using this method repeatedly.
// Set the body of the Email.
$message='This Email is sent by PHPMailer of WordPress';
// Set "From" segment of header.
// For 163.com Email service, it must be the same
// with your account.
// Set addresser's name
// Set the title
// Set the SMTP server.
// Set "need authentication".
// Set your username and password.
// Send Email.
Here I described how to use PHPMailer to send Email. Of course, there are other options in PHPMailer class. You can understand the usage of it by reading the source code and trying it in person.