Home > headlines > Examples of how to send emails using PHP (including 9 PHP email classes to download)

Examples of how to send emails using PHP (including 9 PHP email classes to download)

PHP中文网
Release: 2017-07-17 14:40:48
Original
4576 people have browsed it

Recently, there are always students in our php Chinese website QQ group 5 asking how to use the php mail class. Today I will give you some instructions on how to use the mail class.

This article uses the following class library as an explanation of "Powerful PHP Email Sending Class" Click on the title to go to the class library. If you need to view more php class libraries, you can click the link below: //m.sbmmt.com/xiazai/leiku

<?php
/**
 *实例化邮件类
 */
$smtpserver = "smtp.163.com";              //SMTP服务器
$smtpserverport =25;                      //SMTP服务器端口
$smtpusermail = "240331511@163.com";      //SMTP服务器的用户邮箱
$smtpemailto = "240331511@163.com";       //发送给谁
$smtpuser = "240331511@163.com";         //SMTP服务器的用户帐号
$smtppass = "123147mcl";                 //SMTP服务器的用户密码
$mailsubject = "PHP100测试邮件系统";        //邮件主题
$mailbody = "<h1>你的用户名是张三,密码是123147mcl </h1>";      //邮件内容
$mailtype = "HTML";                      //邮件格式(HTML/TXT),TXT为文本邮件
$smtp = new smtp($smtpserver,$smtpserverport,true,$smtpuser,$smtppass);
$smtp->debug = true;                     //是否显示发送的调试信息
$smtp->sendmail($smtpemailto, $smtpusermail, $mailsubject, $mailbody, $mailtype);
?>
Copy after login

Examples of how to send emails using PHP (including 9 PHP email classes to download)

Directly instantiate this email class and configure it according to the comment content to achieve mass sending of emails.

Note: Since we are using a third-party mail system (such as QQ mailbox), we need to configure the mailbox to a certain extent. The details are as follows:

What are the POP3 and SMTP servers of QQ mailbox?

QQ mailbox POP3 and SMTP server address settings are as follows:


Mailbox POP3 server ( Port 995) SMTP server (port 465 or 587)
qq.com pop.qq.com smtp .qq.com

SMTP server requires authentication.


Examples of how to send emails using PHP (including 9 PHP email classes to download)

Examples of how to send emails using PHP (including 9 PHP email classes to download)

Examples of how to send emails using PHP (including 9 PHP email classes to download)

##What is an authorization code and what is it? How to set it up?

1. What is an authorization code?

The authorization code is launched by QQ Mailbox and is a special password used to log in to third-party clients.

Suitable for logging in to the following services: POP3/IMAP/SMTP/Exchange/CardDAV/CalDAV service.

Warm reminder: For the

security of your account, changing the QQ password and independent password will trigger the authorization code to expire, and you need to obtain a new authorization code to log in.

2. How to obtain the authorization code?

First go to Settings -> Account page to find the entrance, and follow the following process.

(1) Click "Open"

Examples of how to send emails using PHP (including 9 PHP email classes to download)

Examples of how to send emails using PHP (including 9 PHP email classes to download)

Examples of how to send emails using PHP (including 9 PHP email classes to download)## Modify as shown above Once done.


The following are the benefits provided by 9 php email class download addresses

php implements a class for sending emails

Socket in php sends email verification email class

php sends email class

PHP email STMP simple class

Mail sending php class

php-socket sending mail class

php-Mailer mail class

Complete email sending class for php

Related labels:
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