pub fn send(&self, mail: &Message) -> SendgridResult<reqwest::blocking::Response> {
        let client = reqwest::blocking::Client::new();
        let headers = self.get_headers()?;
        let body = mail.gen_json();
        let res = client.post(V3_API_URL).headers(headers).body(body).send()?;
        if !res.status().is_success() {
            Err(SendgridError::RequestNotSuccessful(res.status()))
        } else {
            Ok(res)
        }
    }
/// Send a V3 message and return the HTTP response or an error.
Send a V3 message and return the HTTP response or an error.
Send a V3 message and return the HTTP response or an error .
pub fn send(&self, mail: &Message) -> SendgridResult<reqwest::blocking::Response> {
        let client = reqwest::blocking::Client::new();
        let headers = self.get_headers()?;
        let body = mail.gen_json();
        let res = client.post(V3_API_URL).headers(headers).body(body).send()?;
        if !res.status().is_success() {
            Err(SendgridError::RequestNotSuccessful(res.status()))
        } else {
            Ok(res)
        }
    }
pub fn send ( & self , mail : & Message ) -> SendgridResult < reqwest :: blocking :: Response > { let client = reqwest :: blocking :: Client :: new ( ) ; let headers = self . get_headers ( ) ? ; let body = mail . gen_json ( ) ; let res = client . post ( V3_API_URL ) . headers ( headers ) . body ( body ) . send ( ) ? ; if ! res . status ( ) . is_success ( ) { Err ( SendgridError :: RequestNotSuccessful ( res . status ( ) ) ) } else { Ok ( res ) } }
Send a V3 message and return the HTTP response or an error.
Send a V3 message and return the HTTP response or an error .
&self
mail
&Message
&self
mail
&Message