[][src]Function imap::connect_starttls

pub fn connect_starttls<A: ToSocketAddrs, S: AsRef<str>>(
    addr: A,
    domain: S,
    ssl_connector: &TlsConnector
) -> Result<Client<TlsStream<TcpStream>>>

Connect to a server and upgrade to a TLS-encrypted connection.

This is the STARTTLS equivalent to connect. All notes there also apply here.

Examples

let tls = TlsConnector::builder().build().unwrap();
let client = imap::connect_starttls(("imap.example.org", 143), "imap.example.org", &tls).unwrap();