admin_config/
email_config.rs

1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Clone, Serialize, Deserialize)]
4pub struct EmailConfig {
5    /// SMTP 服务器地址
6    pub smtp_host: String,
7    /// SMTP 端口
8    pub smtp_port: u16,
9    /// SMTP 用户名
10    pub smtp_username: String,
11    /// SMTP 密码
12    pub smtp_password: String,
13    /// 发件人名称
14    pub from_name: String,
15    /// 发件人邮箱
16    pub from_email: String,
17    /// 是否启用 TLS
18    pub enable_tls: bool,
19}
20
21impl Default for EmailConfig {
22    fn default() -> Self {
23        Self {
24            smtp_host: "smtp.gmail.com".to_string(),
25            smtp_port: 587,
26            smtp_username: "".to_string(),
27            smtp_password: "".to_string(),
28            from_name: "系统通知".to_string(),
29            from_email: "".to_string(),
30            enable_tls: true,
31        }
32    }
33}