pub struct EmailConfig {
pub smtp_host: String,
pub smtp_port: u16,
pub smtp_username: String,
pub smtp_password: String,
pub from_name: String,
pub from_email: String,
pub enable_tls: bool,
}Expand description
邮件配置
用于配置 SMTP 邮件服务器和发件人信息
§字段说明
smtp_host: SMTP 服务器地址smtp_port: SMTP 端口,默认 587(TLS)或 465(SSL)smtp_username: SMTP 登录用户名smtp_password: SMTP 登录密码from_name: 发件人显示名称from_email: 发件人邮箱地址enable_tls: 是否启用 TLS 加密,默认 true
§示例
use admin_config::EmailConfig;
let config = EmailConfig::default();
assert_eq!(config.smtp_port, 587);
assert!(config.enable_tls);Fields§
§smtp_host: StringSMTP 服务器地址
smtp_port: u16SMTP 端口
smtp_username: StringSMTP 用户名
smtp_password: StringSMTP 密码
from_name: String发件人名称
from_email: String发件人邮箱
enable_tls: bool是否启用 TLS
Trait Implementations§
Source§impl Clone for EmailConfig
impl Clone for EmailConfig
Source§fn clone(&self) -> EmailConfig
fn clone(&self) -> EmailConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EmailConfig
impl Debug for EmailConfig
Source§impl Default for EmailConfig
impl Default for EmailConfig
Source§impl<'de> Deserialize<'de> for EmailConfig
impl<'de> Deserialize<'de> for EmailConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for EmailConfig
impl RefUnwindSafe for EmailConfig
impl Send for EmailConfig
impl Sync for EmailConfig
impl Unpin for EmailConfig
impl UnwindSafe for EmailConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more