Struct ::exo::be::Email

Overview

An email which can be sent over an SMTP server

Methods

fn new() -> Email

Creates a new email which can be sent over Smtp.

Example

let email = exo::be::Email::new();
assert!(email is exo::be::Email);
fn from(self, from: String) -> Email

Adds the sender of the email

Example

let email = exo::be::Email::new().from("system@exolynk.app");
assert_eq!(email.from, "system@exolynk.app");
fn to(self, to: String) -> Email

Adds a receiver to the email

Example

let email = exo::be::Email::new().to("system@exolynk.app").to("no-replay@exolynk.app");
assert_eq!(email.to, ["system@exolynk.app", "no-replay@exolynk.app"]);
fn cc(self, cc: String) -> Email

Adds a copy receiver to the email

Example

let email = exo::be::Email::new().cc("system@exolynk.app").cc("no-replay@exolynk.app");
assert_eq!(email.cc, ["system@exolynk.app", "no-replay@exolynk.app"]);
fn bcc(self, bcc: String) -> Email

Adds a hidden receiver to the email

Example

let email = exo::be::Email::new().bcc("system@exolynk.app").bcc("no-replay@exolynk.app");
assert_eq!(email.bcc, ["system@exolynk.app", "no-replay@exolynk.app"]);
fn subject(self, subject: String) -> Email

Adds the subject of the email

Example

let email = exo::be::Email::new().subject("Exolynk System Email");
assert_eq!(email.subject, "Exolynk System Email");
fn body(self, body: String) -> Email

Sets the message of the email within a Exolynk styled html theme. This theme takes the email subject as a title.

Example

let email = exo::be::Email::new().body("This is a test message");
assert_eq!(email.body_plain, "This is a test message");
fn body_plain(self, plain_body: String) -> Email

Sets the message of the email within a plain body.

Example

let email = exo::be::Email::new().body_plain("This is a test message");
assert_eq!(email.body_plain, "This is a test message");
fn body_html(self, body: String, html: String) -> Email

Sets the message of the email within a Exolynk styled html theme.

Example

let email = exo::be::Email::new().body_html("Message", "<h1>Message</h1>");
assert_eq!(email.body_plain, "Message");
assert_eq!(email.body_html, "<h1>Message</h1>");

Protocols

protocol get from
let output = value.from

Allows a get operation to work.

protocol set from
value.from = input

Allows a set operation to work.

protocol get to
let output = value.to

Allows a get operation to work.

protocol set to
value.to = input

Allows a set operation to work.

protocol get bcc
let output = value.bcc

Allows a get operation to work.

protocol set bcc
value.bcc = input

Allows a set operation to work.

protocol get cc
let output = value.cc

Allows a get operation to work.

protocol set cc
value.cc = input

Allows a set operation to work.

protocol get subject
let output = value.subject

Allows a get operation to work.

protocol set subject
value.subject = input

Allows a set operation to work.

protocol get body_plain
let output = value.body_plain

Allows a get operation to work.

protocol set body_plain
value.body_plain = input

Allows a set operation to work.

protocol get body_html
let output = value.body_html

Allows a get operation to work.

protocol set body_html
value.body_html = input

Allows a set operation to work.