mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-11-26 05:21:00 +00:00
Initialize SMTP client with port number
This commit is contained in:
parent
6f8d5c1eb4
commit
8888dbba0a
1 changed files with 2 additions and 2 deletions
|
@ -51,13 +51,13 @@ mod mailer {
|
||||||
extension::ClientId,
|
extension::ClientId,
|
||||||
ConnectionReuseParameters, SmtpClient, SmtpTransport,
|
ConnectionReuseParameters, SmtpClient, SmtpTransport,
|
||||||
};
|
};
|
||||||
use plume_models::CONFIG;
|
use plume_models::{SmtpNewWithAddr, CONFIG};
|
||||||
|
|
||||||
pub type Mailer = Option<SmtpTransport>;
|
pub type Mailer = Option<SmtpTransport>;
|
||||||
|
|
||||||
pub fn init() -> Mailer {
|
pub fn init() -> Mailer {
|
||||||
let config = CONFIG.mail.as_ref()?;
|
let config = CONFIG.mail.as_ref()?;
|
||||||
let mail = SmtpClient::new_simple(&config.server)
|
let mail = SmtpClient::new_with_addr((&config.server, config.port))
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.hello_name(ClientId::Domain(config.helo_name.clone()))
|
.hello_name(ClientId::Domain(config.helo_name.clone()))
|
||||||
.credentials(Credentials::new(
|
.credentials(Credentials::new(
|
||||||
|
|
Loading…
Reference in a new issue