| Crates.io | brevo-mail |
| lib.rs | brevo-mail |
| version | 0.2.0 |
| created_at | 2025-10-16 11:02:30.13499+00 |
| updated_at | 2025-10-17 10:46:05.775126+00 |
| description | Utility Crate to send transactional E-Mails via Brevo. |
| homepage | |
| repository | https://github.com/firewave-remo/brevo-mail |
| max_upload_size | |
| id | 1885751 |
| size | 238,253 |
Utility Crate to send transactional E-Mails via Brevo.
Take a closer look at the examples folder.
...
#[derive(Parser, Debug)]
struct Cli {
key: String,
sender: String,
to: String,
}
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
let cli = Cli::parse();
let brevo_api_key = BrevoApiKey::from_str(&cli.key)?;
let brevo_options = BrevoOptions::new(brevo_api_key, BrevoEndpoint::default());
let brevo_client = BrevoClient::from_options(brevo_options)?;
let sender = MailAddress::builder().mail(cli.sender).build()?;
let to = MailAddress::builder().mail(cli.to).build()?;
let mail = Mail::builder()
.subject("Test Brevo Lib")
.content(MailContent::text("Test Brevo Lib Content"))
.sender(sender)
.to(vec![to])
.build()?;
brevo_client.send(&mail).await?;
Ok(())
}```
## Brevo Docs
https://developers.brevo.com/docs/send-a-transactional-email
## Brevo API Keys
https://app.brevo.com/settings/keys/api
## Brevo API Reference
https://developers.brevo.com/reference/sendtransacemail
## Example
The example in the `examples` folder shows you how to use the library. You can call the example with:
```bash
cargo run --example send_mail xkeysib-brevo-key <sender-mail> <receiver-mail>