[−][src]Struct mail_smtp::ConnectionConfig
Configuration specifing how to setup an SMTP connection.
Use the ConnectionBuilder
to crate it.
(Expect if you need a unencrypted connection, in which
case you have to crate it by hand. It's not recommended
to use unencrypted connections for mail).
Example
use new_tokio_smtp::{ConnectionBuilder, Domain}; use new_tokio_smtp::command::auth::Login; // For connecting with auth Login using the defaults, i.e.: // STARTTLS, port 587 and the ip gotten from resolving // the passed in domain/host name as well as the hostname // as client identity. let host = "smtp.gmail.com".parse() .expect("malformed domain/host name"); let config = ConnectionBuilder ::new(host) .expect("could not resolve host name") .auth(Login::new("user", "password")) .build();
Fields
addr: SocketAddr
the address and port to connect to (i.e. the ones of the smtp server)
auth_cmd: A
a command used for authentication (use NOOP if you don't auth)
security: Security<S>
the kind of TLS mechanism used when setting up the connection
client_id: ClientId
the client identity, i.e. your "identity"
This is relevant for the communication between smtp server, through
for connecting to an MSA (e.g. thunderbird connecting to gmail)
using localhost ([127.0.0.1]
) is enough
Methods
impl<A> ConnectionConfig<A, DefaultTlsSetup> where
A: Cmd,
[src]
A: Cmd,
pub fn connect(
self
) -> impl Send + Future<Item = Connection, Error = ConnectingFailed>
[src]
self
) -> impl Send + Future<Item = Connection, Error = ConnectingFailed>
Calls Connection::connect(self)
.
impl ConnectionConfig<Noop, DefaultTlsSetup>
[src]
pub fn builder_local_unencrypted() -> LocalNonSecureBuilder<Noop>
[src]
Creates a connection to 127.0.01
without any form of encryption.
While this is possible it is not a good idea use this for anything but test setups.
pub fn builder(
host: Domain
) -> Result<ConnectionBuilder<Noop, DefaultTlsSetup>, Error>
[src]
host: Domain
) -> Result<ConnectionBuilder<Noop, DefaultTlsSetup>, Error>
pub fn builder_with_port(
host: Domain,
port: u16
) -> Result<ConnectionBuilder<Noop, DefaultTlsSetup>, Error>
[src]
host: Domain,
port: u16
) -> Result<ConnectionBuilder<Noop, DefaultTlsSetup>, Error>
pub fn builder_with_addr(
addr: SocketAddr,
domain: Domain
) -> ConnectionBuilder<Noop, DefaultTlsSetup>
[src]
addr: SocketAddr,
domain: Domain
) -> ConnectionBuilder<Noop, DefaultTlsSetup>
Trait Implementations
impl<A, S> Debug for ConnectionConfig<A, S> where
A: Debug + Cmd,
S: Debug + SetupTls,
[src]
A: Debug + Cmd,
S: Debug + SetupTls,
impl<A, S> Clone for ConnectionConfig<A, S> where
A: Clone + Cmd,
S: Clone + SetupTls,
[src]
A: Clone + Cmd,
S: Clone + SetupTls,
fn clone(&self) -> ConnectionConfig<A, S>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl<A, S> Send for ConnectionConfig<A, S>
impl<A, S> Sync for ConnectionConfig<A, S> where
A: Sync,
S: Sync,
A: Sync,
S: Sync,
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Erased for T
impl<T> HeaderTryFrom for T
[src]
fn try_from(val: T) -> Result<T, ComponentCreationError>
[src]
impl<F, T> HeaderTryInto for F where
T: HeaderTryFrom<F>,
[src]
T: HeaderTryFrom<F>,