# Mail Configuration
BeikeShop emails can be configured in Backstage-System Settings-Email Settings
The mail engines supported by BeikeShop are: SMTP, Sendmail, Mailgun
Note: The email address in the BeikeShop backend system settings-basic settings must be consistent with the user in the email settings
# QQ Mail
Enter QQ mailbox, click "Settings-Account"
Enable POP3/SMTP service, click the arrow to view the format, and generate the authorization code:
Get the SMTP server and port. Each mailbox has a different SMTP server.
Email configuration:
Enter BeikeShopBackstage-System Settings-Email Settings
,select the email engine: SMTP, and fill in the following information in sequence
Host: smtp.qq.com
User: QQ mailbox
Password: Authorization code
Port: 465
Save after configuration
Note: The email address in the BeikeShop backend system settings-basic settings must be consistent with the user in the email settings
# 163Mailbox
Enter 163 mailbox. Click Settings-POP3/SMTP/IMAP
Enable POP3/SMTP service and generate authorization code
Get the SMTP server, the port is usually 465, except for special emails!
Email configuration:
Enter BeikeShopBackstage-System Settings-Email Settings
, select the email engine: SMTP, and fill in the following information in sequence
Host: smtp.163.com
User: 163 mailbox
Password: Authorization code
Port: 465
Save after configuration
Note: The email address in the BeikeShop backend system settings-basic settings must be consistent with the user in the email settings.
# Gmail
Gmail are not applicable in China and will be directly rejected by Google.
Official reference document for Google mailboxes: https://support.google.com/mail/answer/7126229?visit_id=637245836154040494-1719467026&hl=zh-Hans&rd=1
First, you need to apply for a Google mailbox. The specific application steps will not be explained.
Set a dedicated SMTP password, https://security.google.com/settings/security/apppasswords
Email configuration:
Enter BeikeShopBackstage-System Settings-Email Settings
, select the email engine: SMTP, and fill in the following information in sequence
Host: smtp.gmail.com
User: gmail mailbox
Password: gmail application-specific password
Port: 465
Save after configuration
Note: The email address in the BeikeShop backend system settings-basic settings must be consistent with the user in the email settings
# Queue Configuration
Enable the queue to process mail tasks. The configuration steps are as follows:
1.Configuring a database driver to handle queues
(1)In the .env file, set the queue driver to database
QUEUE_CONNECTION=database
(2)Execute the command to create the table(failed_jobs、jobs)
php artisan queue:table
php artisan migrate
These two commands will create the jobs table for storing queue tasks and the failed_jobs table for storing failed tasks respectively.
(3)Confirm that other parameters of the email have been configured (refer to email configuration)
(4)Execute the command to enable queue monitoring
php artisan queue:work -v
2.Dealing with Common Problems
(1)View related tables failed_jobs, jobs, and notifications (You can use database management tools to view the data in these tables.)
(2)View the console output information (When executing the php artisan queue:work -v command, the console will output the execution process of the task. If there is a problem, it will display error information to help you diagnose the problem during the task processing.)
3.Other queue drivers (such as Redis) can be configured
4.In a production environment, you need a way to keep queue:work processes running. queue:work processes can stop running for a variety of reasons, such as exceeding a worker timeout or executing a queue:restart command. For this reason, you need to configure a process monitor that can detect when your queue:work processes exit and automatically restart them. In addition, a process monitor allows you to specify how many queue:work processes to run simultaneously. Supervisor is a commonly used process monitor in Linux environments. The configuration method can refer to the following document. https://learnku.com/docs/laravel/10.x/queues/14873#e45763 (opens new window)
# Email Configuration FAQ
1.How to change the sender of an email?
A: Modify the APP_NAME in the .env file in the root directory of the website
2.Registered user error: "Server Error"
Open the website debug, then register to see the error message [.env file in the website root directory APP_DEBUG=true]
The following error message appears:
A: The email address in the BeikeShop backend system settings-basic settings needs to be consistent with the user in the email settings.
The following error message appears:
A: (1) Check whether the SMTP server address or port is filled in correctly; (2) Check your server network, or whether the server has any restrictions on the port.
3.The user registration was successful, but no email was received
A:
(1)Check whether the queue is used. If the queue is used, you need to enable queue monitoring and check whether there is a failure (FAIL) message returned.
Execute the command to enable queue monitoring
php artisan queue:work -v
(2)Disable the queue, turn on debug, and then register to view the error message to check the problem