pub(crate) struct Smtp {
transport: Option<SmtpTransport<Box<dyn SessionBufStream>>>,
from: Option<EmailAddress>,
last_success: Option<Time>,
pub(crate) connectivity: ConnectivityStore,
pub(crate) last_send_error: Option<String>,
}
Fields§
§transport: Option<SmtpTransport<Box<dyn SessionBufStream>>>
SMTP connection.
from: Option<EmailAddress>
Email address we are sending from.
last_success: Option<Time>
Timestamp of last successful send/receive network interaction (eg connect or send succeeded). On initialization and disconnect it is set to None.
connectivity: ConnectivityStore
§last_send_error: Option<String>
If sending the last message failed, contains the error message.
Implementations§
source§impl Smtp
impl Smtp
sourcepub fn disconnect(&mut self)
pub fn disconnect(&mut self)
Disconnect the SMTP transport and drop it entirely.
sourcepub fn has_maybe_stale_connection(&self) -> bool
pub fn has_maybe_stale_connection(&self) -> bool
Return true if smtp was connected but is not known to have been successfully used the last 60 seconds
sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Check whether we are connected.
sourcepub async fn connect_configured(&mut self, context: &Context) -> Result<()>
pub async fn connect_configured(&mut self, context: &Context) -> Result<()>
Connect using configured parameters.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Smtp
impl !RefUnwindSafe for Smtp
impl Send for Smtp
impl Sync for Smtp
impl Unpin for Smtp
impl !UnwindSafe for Smtp
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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