Struct async_smtp::SmtpTransport 
source · pub struct SmtpTransport<S: BufRead + Write + Unpin> { /* private fields */ }Expand description
Structure that implements the high level SMTP client
Implementations§
source§impl<S: BufRead + Write + Unpin> SmtpTransport<S>
 
impl<S: BufRead + Write + Unpin> SmtpTransport<S>
sourcepub async fn new(builder: SmtpClient, stream: S) -> Result<Self, Error>
 
pub async fn new(builder: SmtpClient, stream: S) -> Result<Self, Error>
Creates a new SMTP transport and connects.
sourcepub async fn try_login(
    &mut self,
    credentials: &Credentials,
    accepted_mechanisms: &[Mechanism]
) -> Result<(), Error>
 
pub async fn try_login( &mut self, credentials: &Credentials, accepted_mechanisms: &[Mechanism] ) -> Result<(), Error>
Try to login with the given accepted mechanisms.
sourcepub async fn starttls(self) -> Result<S, Error>
 
pub async fn starttls(self) -> Result<S, Error>
Sends STARTTLS command if the server supports it.
Returns inner stream which should be upgraded to TLS.
sourcepub async fn auth(
    &mut self,
    mechanism: Mechanism,
    credentials: &Credentials
) -> SmtpResult
 
pub async fn auth( &mut self, mechanism: Mechanism, credentials: &Credentials ) -> SmtpResult
Sends an AUTH command with the given mechanism, and handles challenge if needed
sourcepub async fn send(&mut self, email: SendableEmail) -> SmtpResult
 
pub async fn send(&mut self, email: SendableEmail) -> SmtpResult
Sends an email.