SmtpClient

Struct SmtpClient 

Source
pub struct SmtpClient { /* private fields */ }
Expand description

SMTP client with advanced features

Implementations§

Source§

impl SmtpClient

Source

pub async fn connect(server: NetworkAddress) -> Result<Self>

Connects to SMTP server

Source

pub async fn connect_with_security( server: NetworkAddress, _security: SmtpSecurity, ) -> Result<Self>

Connects with specific security mode

Source

pub async fn ehlo(&mut self, domain: &str) -> Result<()>

Sends EHLO and discovers capabilities

Source

pub async fn auth_plain(&mut self, username: &str, password: &str) -> Result<()>

Authenticates using PLAIN mechanism

Source

pub async fn auth_login(&mut self, username: &str, password: &str) -> Result<()>

Authenticates using LOGIN mechanism

Source

pub async fn auth_xoauth2( &mut self, username: &str, access_token: &str, ) -> Result<()>

Authenticates using XOAUTH2 (for Gmail/Outlook)

Source

pub async fn send_email(&mut self, email: &Email) -> Result<()>

Sends email with multipart support

Source

pub async fn verify(&mut self, email: &str) -> Result<bool>

Verifies email address

Source

pub async fn reset(&mut self) -> Result<()>

Resets session

Source

pub async fn quit(&mut self) -> Result<()>

Closes connection

Source

pub fn capabilities(&self) -> Option<&AuthCapabilities>

Gets capabilities

Source

pub fn is_authenticated(&self) -> bool

Checks if authenticated

Source

pub fn set_timeout(&mut self, timeout: Duration)

Sets timeout for operations

Source

pub fn timeout(&self) -> Duration

Gets current timeout

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.