Crates.io | smsaero |
lib.rs | smsaero |
version | 1.0.0 |
source | src |
created_at | 2024-07-22 04:44:03.234882 |
updated_at | 2024-07-22 04:44:03.234882 |
description | Library for sending SMS messages using the SmsAero API |
homepage | https://github.com/smsaero/smsaero_rust |
repository | https://github.com/smsaero/smsaero_rust |
max_upload_size | |
id | 1310846 |
size | 15,184 |
Library for sending SMS messages using the SmsAero API. Written in Rust.
cargo install smsaero
Get credentials from account settings page: https://smsaero.ru/cabinet/settings/apikey/
use chrono::Utc;
use serde_json::Value;
use std::error::Error;
use smsaero::SmsAero;
const SMSAERO_EMAIL: &str = "your email";
const SMSAERO_API_KEY: &str = "your api key";
fn main() -> Result<(), Box<dyn Error>> {
let client = SmsAero::new(
SMSAERO_EMAIL.to_string(),
SMSAERO_API_KEY.to_string(),
None,
None,
);
match client.send_sms("70000000000", "Hello, world!", None, None) {
Ok(result) => println!("{}", result),
Err(e) => eprintln!("SmsAero error: {}", e),
}
Ok(())
}
MIT License