We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3075678 commit fe59c5eCopy full SHA for fe59c5e
src/smtp/builder.rs
@@ -11,6 +11,7 @@
11
use crate::{Credentials, SmtpClient, SmtpClientBuilder};
12
use smtp_proto::{EhloResponse, EXT_START_TLS};
13
use std::hash::Hash;
14
+use std::net::IpAddr;
15
use std::time::Duration;
16
use tokio::net::ToSocketAddrs;
17
use tokio::{
@@ -26,8 +27,12 @@ where
26
27
for<'a> (&'a T, u16): ToSocketAddrs,
28
{
29
pub fn new(hostname: T, port: u16) -> Self {
30
+ SmtpClientBuilder::new_bind_ip(hostname, None, port)
31
+ }
32
+
33
+ pub fn new_bind_ip(hostname: T, addr: Option<IpAddr>, port: u16) -> Self {
34
SmtpClientBuilder {
- addr: None,
35
+ addr,
36
port,
37
timeout: Duration::from_secs(60 * 60),
38
tls_connector: build_tls_connector(false),
0 commit comments