- I built a cli that sends emails with attachments from the command line.
- I built it using the following crates
1. clap - for cli functionality
2. lettre - to send emails
3. tokio - for asynchronous tasks
4. base64 - for encrypting and decrypting passwords
5. colored - For colored std output
## What I learnt
1. I learnt how to send emails using the lettre crate.
- I had issues with figuring out how to send the attachment and realized I had to
use the singlepart function and pass in the file name.
- I learnt how to setup my gmail app password to allow it to be used on the cli
2. I encrypted and decrypted the user password using base64
- I used bcrypt at first but I wasn't able to get the decrypted password value
as it only allowed for it to be verified. I needed the actual value to pass into
the lettre mail builder as the password was being stored in redis memory
3. Only used one asynchronous function, but I am getting more familiar with how they work
in rust.
4. I did more error handling by using match or unwrap_or_else which returns the Ok value
or the computed value from the closure it takes in. I mainly used unwrap_or_else for anything
that would be an internal error
5. Learned to use std.process.exit to terminate the process early if and error happens