toml
ohmysmtp = { git = "https://github.com/sigaloid/ohmysmtp" }
```rust use ohmysmtp::{Email, File, FileType, OhMySmtp};
let emailservice = OhMySmtp::new("APIKEY");
let result = email_service.send(&Email::new( "from@email.address", "to@email.address", "Body text", ));
let emailadvancedexample = Email::new("from@email.address", "to@email.address", "Body text") .withsubject("Subject line") .withattachment(File::new(b"File!", "file-name.txt", & FileType::Txt));
match emailservice.send( & emailadvanced_example) { Ok(()) => println ! ("Success!"), Err(e) => println ! ("Error :(") } ```
Want to say thanks for this library? Just click the button below and leave a brief note. It would make my day :)