Add email verification.

This commit is contained in:
Paul Makles
2020-01-25 10:26:56 +00:00
parent 845a6bb3dd
commit 70b4111259
6 changed files with 419 additions and 15 deletions

18
src/email.rs Normal file
View File

@@ -0,0 +1,18 @@
use reqwest::blocking::Client;
use std::collections::HashMap;
pub fn send_email(target: String, subject: String, body: String, html: String) -> Result<(), ()> {
let mut map = HashMap::new();
map.insert("target", target.clone());
map.insert("subject", subject);
map.insert("body", body);
map.insert("html", html);
let client = Client::new();
match client.post("http://192.168.0.26:3838/send")
.json(&map)
.send() {
Ok(_) => Ok(()),
Err(_) => Err(())
}
}