You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: mail.rs
    path of file: ./repos/fastn/fastn-core/src
    
    the code of the file until where you have to start completion: #[derive(thiserror::Error, Debug)]
pub enum MailError {
    #[error("Mail Error: {0}")]
    Mail(#[from] lettre::error::Error),
    #[error("Address Parse Error: {0}")]
    Address(#[from] lettre::address::AddressError),
    #[error("SMTP Error: {0}")]
    Smtp(#[from] lettre::transport::smtp::Error),
}

/// Send SMTP emails
pub struct Mailer {
    smtp_username: String,
    smtp_password: String,
    smtp_host: String,
    sender_email: String,
    sender_name: Option<String>,
}

impl Mailer {
   
    
    async fn from_env(ds: &fastn_ds::DocumentStore) -> Result<Self, fastn_ds::EnvironmentError> {
        let smtp_username = ds.env("FASTN_SMTP_USERNAME").await?;
        let smtp_password = ds.env("FASTN_SMTP_PASSWORD").await?;
        let smtp_host = ds.env("FASTN_SMTP_HOST").await?;
        let sender_email = ds.env("FASTN_SMTP_SENDER_EMAIL").await?;
        let sender_name = ds.env("FASTN_SMTP_SENDER_NAME").await.ok();

        Ok(Mailer {
            smtp_username,
            smtp_password,
            sender_email,
            sender_name,
            smtp_host,
        })
    }