Expand description
The crate provides an interface to Postal’s http API.
§Examples
use postal_rs::{Client, DetailsInterest, Message, SendResult};
use std::env;
#[tokio::main]
async fn main() {
let address = env::var("POSTAL_ADDRESS").unwrap_or_default();
let token = env::var("POSTAL_TOKEN").unwrap_or_default();
let message = Message::default()
.to(&["example@gmail.com".to_owned()])
.from("test@yourserver.io")
.subject("Hello World")
.text("A test message");
let client = Client::new(address, token).unwrap();
let _ = client
.send(message)
.await
.unwrap();
}
Structs§
- Client
- Client holds a session information
- Details
Interest - DetailsInterest contains an options which can be used to turn on expansions while obtaining details of a message.
- Message
- Message represents a email which can be sent
- RawMessage
- RawMessage allows you to send us a raw RFC2822 formatted message along with the recipients that it should be sent to.
- Send
Result - SendResult represent a result of sending request
Enums§
- Postal
Error - PostalError denotes crate erorrs
Type Aliases§
- Message
Hash - MessageHash represents a hash which can be used to get a different information bout a message.