Crates.io | mailgun_v3 |
lib.rs | mailgun_v3 |
version | 0.14.0 |
source | src |
created_at | 2018-08-07 18:24:11.168553 |
updated_at | 2023-01-04 02:44:45.685691 |
description | reqwest based web bindings for Mailgun's v3 JSON API |
homepage | |
repository | https://github.com/otterandrye/mailgun_v3 |
max_upload_size | |
id | 78248 |
size | 65,044 |
reqwest based web bindings for Mailgun's v3 JSON API
https://docs.rs/mailgun_v3/latest/mailgun_v3/
Sending an email
use mailgun_v3::email::{Message, EmailAddress, MessageBody};
use mailgun_v3::Credentials;
fn main(){
let msg = Message {
to: vec![EmailAddress::address("target@example.org")],
body: MessageBody::Text("hello world".to_string()),
subject: String::from("sample subject"),
..Default::default()
};
let sender = EmailAddress::address("sender@example.org");
let creds = Credentials::new(
"key-abc1234567890",
"example.org",
);
let res = mailgun_v3::email::send_email(&creds, &sender, msg);
println!("{:?}", res);
}
More examples can be found in the examples directory.