[−][src]Function async_imap::connect
pub async fn connect<A: ToSocketAddrs, S: AsRef<str>>(
addr: A,
domain: S,
ssl_connector: TlsConnector
) -> Result<Client<TlsStream<TcpStream>>>
Connect to a server using a TLS-encrypted connection.
The returned Client
is unauthenticated; to access session-related methods (through
Session
), use Client::login
or Client::authenticate
.
The domain must be passed in separately from the TlsConnector
so that the certificate of the
IMAP server can be validated.
Examples
let tls = async_native_tls::TlsConnector::new(); let client = async_imap::connect(("imap.example.org", 993), "imap.example.org", tls).await?;