Skip to content

Commit fe59c5e

Browse files
committed
add new_bind_ip
1 parent 3075678 commit fe59c5e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/smtp/builder.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use crate::{Credentials, SmtpClient, SmtpClientBuilder};
1212
use smtp_proto::{EhloResponse, EXT_START_TLS};
1313
use std::hash::Hash;
14+
use std::net::IpAddr;
1415
use std::time::Duration;
1516
use tokio::net::ToSocketAddrs;
1617
use tokio::{
@@ -26,8 +27,12 @@ where
2627
for<'a> (&'a T, u16): ToSocketAddrs,
2728
{
2829
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 {
2934
SmtpClientBuilder {
30-
addr: None,
35+
addr,
3136
port,
3237
timeout: Duration::from_secs(60 * 60),
3338
tls_connector: build_tls_connector(false),

0 commit comments

Comments
 (0)