pub fn new<A: ToSocketAddrs>(addr: A, security: ClientSecurity) -> Result<SmtpClient, Error> {
        let mut addresses = addr.to_socket_addrs()?;

        match addresses.next() {
            Some(addr) => Ok(SmtpClient {
                server_addr: addr,
                security,
                smtp_utf8: false,
                credentials: None,
                connection_reuse: ConnectionReuseParameters::NoReuse,
                hello_name: ClientId::hostname(),
                authentication_mechanism: None,
                force_set_auth: false,
                timeout: Some(Duration::new(60, 0)),
            }),
            None => Err(Error::Resolution),
        }
    }
/// Creates a new SMTP client
///
/// Defaults are:
///
/// * No connection reuse
/// * No authentication
/// * No SMTPUTF8 support
/// * A 60 seconds timeout for smtp commands
///
/// Consider using [`SmtpClient::new_simple`] instead, if possible.
Creates a new SMTP client
Defaults are.

No connection reuse
No authentication
No SMTPUTF8 support
A 60 seconds timeout for smtp commands


Creates a new SMTP client Defaults are . No connection reuse No authentication No SMTPUTF8 support A 60 seconds timeout for smtp commands
pub fn new<A: ToSocketAddrs>(addr: A, security: ClientSecurity) -> Result<SmtpClient, Error> {
        let mut addresses = addr.to_socket_addrs()?;
        match addresses.next() {
            Some(addr) => Ok(SmtpClient {
                server_addr: addr,
                security,
                smtp_utf8: false,
                credentials: None,
                connection_reuse: ConnectionReuseParameters::NoReuse,
                hello_name: ClientId::hostname(),
                authentication_mechanism: None,
                force_set_auth: false,
                timeout: Some(Duration::new(60, 0)),
            }),
            None => Err(Error::Resolution),
        }
    }
pub fn new < A : ToSocketAddrs > ( addr : A , security : ClientSecurity ) -> Result < SmtpClient , Error > { let mut addresses = addr . to_socket_addrs ( ) ? ; match addresses . next ( ) { Some ( addr ) => Ok ( SmtpClient { server_addr : addr , security , smtp_utf8 : false , credentials : None , connection_reuse : ConnectionReuseParameters :: NoReuse , hello_name : ClientId :: hostname ( ) , authentication_mechanism : None , force_set_auth : false , timeout : Some ( Duration :: new ( 60 , 0 ) ) , } ) , None => Err ( Error :: Resolution ) , } }
Creates a new SMTP client
Defaults are:
Creates a new SMTP client Defaults are :
addr
A
security
ClientSecurity
addr
A
security
ClientSecurity