采用前后端分离架构
后端:python + socket编程,flask框架搭建后端服务器,mysql数据库
前端:react + node.js前端服务器
在数据库中创建smtp数据库
使用项目根目录下的smtp.sql
进行数据库表的初始化,输入如下命令:
mysql -u root -p smtp < ./smtp.sql
配置/backend/utils/databaseConfig.py
中的数据库连接参数
在/backend/utils
文件下新建SMTPSenderConfig.yaml
文件,配置smtp服务
配置如下属性:
mailServer: smtp.qq.com
serverPort: 587
fromAddress: xxxx@xx.com
username: xxxx
password: *** #smtp服务密码而非邮箱密码
在backend
目录下运行:
python ./__init__.py
需要安装node.js
在/frontend/react-front
目录下运行:
npm install
npm start
即可运行开发服务器
可使用npm run build
打包发布,使用serve -s build
运行部署服务器