pub struct SmtpClient { /* private fields */ }Expand description
SMTP client with advanced features
Implementations§
Source§impl SmtpClient
impl SmtpClient
Sourcepub async fn connect(server: NetworkAddress) -> Result<Self>
pub async fn connect(server: NetworkAddress) -> Result<Self>
Connects to SMTP server
Sourcepub async fn connect_with_security(
server: NetworkAddress,
_security: SmtpSecurity,
) -> Result<Self>
pub async fn connect_with_security( server: NetworkAddress, _security: SmtpSecurity, ) -> Result<Self>
Connects with specific security mode
Sourcepub async fn auth_plain(&mut self, username: &str, password: &str) -> Result<()>
pub async fn auth_plain(&mut self, username: &str, password: &str) -> Result<()>
Authenticates using PLAIN mechanism
Sourcepub async fn auth_login(&mut self, username: &str, password: &str) -> Result<()>
pub async fn auth_login(&mut self, username: &str, password: &str) -> Result<()>
Authenticates using LOGIN mechanism
Sourcepub async fn auth_xoauth2(
&mut self,
username: &str,
access_token: &str,
) -> Result<()>
pub async fn auth_xoauth2( &mut self, username: &str, access_token: &str, ) -> Result<()>
Authenticates using XOAUTH2 (for Gmail/Outlook)
Sourcepub async fn send_email(&mut self, email: &Email) -> Result<()>
pub async fn send_email(&mut self, email: &Email) -> Result<()>
Sends email with multipart support
Sourcepub fn capabilities(&self) -> Option<&AuthCapabilities>
pub fn capabilities(&self) -> Option<&AuthCapabilities>
Gets capabilities
Sourcepub fn is_authenticated(&self) -> bool
pub fn is_authenticated(&self) -> bool
Checks if authenticated
Sourcepub fn set_timeout(&mut self, timeout: Duration)
pub fn set_timeout(&mut self, timeout: Duration)
Sets timeout for operations
Auto Trait Implementations§
impl !Freeze for SmtpClient
impl RefUnwindSafe for SmtpClient
impl Send for SmtpClient
impl Sync for SmtpClient
impl Unpin for SmtpClient
impl UnwindSafe for SmtpClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more