[−][src]Struct new_tokio_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
syntax_error_handling: SyntaxErrorHandling
How strict error handling is done.
Implementations
impl<A> ConnectionConfig<A, DefaultTlsSetup> where
A: Cmd,
[src]
A: Cmd,
pub fn connect(
self
) -> impl Future<Item = Connection, Error = ConnectingFailed> + Send
[src]
self
) -> impl Future<Item = Connection, Error = ConnectingFailed> + Send
Calls Connection::connect(self)
.
impl ConnectionConfig<Noop, DefaultTlsSetup>
[src]
pub fn builder_local_unencrypted() -> LocalNonSecureBuilder<Noop>
[src]
Creates a connection to 127.0.0.1
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: Clone, S: Clone> Clone for ConnectionConfig<A, S> where
S: SetupTls,
A: Cmd,
[src]
S: SetupTls,
A: Cmd,
fn clone(&self) -> ConnectionConfig<A, S>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<A: Debug, S: Debug> Debug for ConnectionConfig<A, S> where
S: SetupTls,
A: Cmd,
[src]
S: SetupTls,
A: Cmd,
Auto Trait Implementations
impl<A, S> RefUnwindSafe for ConnectionConfig<A, S> where
A: RefUnwindSafe,
S: RefUnwindSafe,
A: RefUnwindSafe,
S: RefUnwindSafe,
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,
impl<A, S> Unpin for ConnectionConfig<A, S> where
A: Unpin,
S: Unpin,
A: Unpin,
S: Unpin,
impl<A, S> UnwindSafe for ConnectionConfig<A, S> where
A: UnwindSafe,
S: UnwindSafe,
A: UnwindSafe,
S: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> 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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,