Joke Collection Website - Public benefit messages - The verification code sent by tp5 mailbox POP3 cannot be used on the server. Why?

The verification code sent by tp5 mailbox POP3 cannot be used on the server. Why?

First, start the SMTP service (SMTP service is needed to send mail using php, here, take the SMTP service of 163 mailbox as an example).

1. Log in to 163 and find "Settings" on the home page.

2. Select the service to be opened, generally, POP3/SMTP/IMAP. To open the SMTP service, you must first open the customer authorization code.

3. Click Open Customer Authorization Code, and then select Open.

4. You need a mobile phone verification code, and you need to bind the mobile phone number.

5.SMTP service needs to enter the client authorization password. This password is your login password in the mailbox of the third-party client (it will be used later when sending mail using phpmailer). If you enter your previous email login password on a third-party client, an error will occur.

6. After setting the client authorization password, the SMTP service was successfully opened.

Second, download the phpmailer compressed package first.

Create a new mailer folder in the extend directory of thinkphp5 project, and then copy the files from phpmailer.php and smtp.php to this directory.

In phpmailer.php, change the namespace at the top to

Namespace mailer;

increase

Use thinking \ abnormal;

The modified namespace in smtp.php is

Namespace mailer;