Skip to content

Reqwest based web bindings for Mailgun's v3 JSON API

License

Notifications You must be signed in to change notification settings

slowtec/mailgun_v3

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mailgun_v3

Build Status Current Crates.io Version

reqwest based web bindings for Mailgun's v3 JSON API

https://docs.rs/mailgun_v3/latest/mailgun_v3/

currently implemented

  • email send
  • email validation

Examples

Sending an email

use mailgun_v3::email::Message;
use mailgun_v3::email::EmailAddress;
use mailgun_v3::email::MessageBody;
use mailgun_v3::Credentials;

fn main(){
    let msg = Message {
        to: vec![EmailAddress::address("[email protected]")],
        body: MessageBody::Text("hello world".to_string()),
        subject: String::from("sample subject"),
        ..Default::default()
    };
    let sender = EmailAddress::address("[email protected]");
    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.

About

Reqwest based web bindings for Mailgun's v3 JSON API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%