pub fn send_email(&mut self, email: Email) -> Result<String, Error> {
        let (prepared_email, internal_message_status) =
            crate::prepared_email::prepare_email(email, &*self.config.helo_name)?;

        let message_id = internal_message_status.message_id.clone();

        {
            // Lock the storage
            let mut guard = match (*self.storage).write() {
                Ok(guard) => guard,
                Err(_) => return Err(Error::Lock),
            };

            // Store the email
            (*guard).store(prepared_email, internal_message_status)?;
        }

        self.sender.send(Message::SendEmail(message_id.clone()))?;

        info!("Passed email {} off to worker", &*message_id);

        Ok(message_id)
    }
/// Send an email, getting back its message-id
Send an email, getting back its message-id
Send an email getting back its message - id
pub fn send_email(&mut self, email: Email) -> Result<String, Error> {
        let (prepared_email, internal_message_status) =
            crate::prepared_email::prepare_email(email, &*self.config.helo_name)?;
        let message_id = internal_message_status.message_id.clone();
        {
            // Lock the storage
            let mut guard = match (*self.storage).write() {
                Ok(guard) => guard,
                Err(_) => return Err(Error::Lock),
            };
            // Store the email
            (*guard).store(prepared_email, internal_message_status)?;
        }
        self.sender.send(Message::SendEmail(message_id.clone()))?;
        info!("Passed email {} off to worker", &*message_id);
        Ok(message_id)
    }
pub fn send_email ( & mut self , email : Email ) -> Result < String , Error > { let ( prepared_email , internal_message_status ) = crate :: prepared_email :: prepare_email ( email , & * self . config . helo_name ) ? ; let message_id = internal_message_status . message_id . clone ( ) ; { // Lock the storage let mut guard = match ( * self . storage ) . write ( ) { Ok ( guard ) => guard , Err ( _ ) => return Err ( Error :: Lock ) , } ; // Store the email ( * guard ) . store ( prepared_email , internal_message_status ) ? ; } self . sender . send ( Message :: SendEmail ( message_id . clone ( ) ) ) ? ; info ! ( " " message_id ) ; Ok ( message_id ) }
Send an email, getting back its message-id
Send an email getting back its message - id
&mut self
email
Email
&mut self
email
Email