Crates.io | sendmail |
lib.rs | sendmail |
version | 2.0.0 |
source | src |
created_at | 2015-07-22 17:36:34.647538 |
updated_at | 2018-03-19 17:02:28.90916 |
description | Rust sending emails via sendmail. Works nicely with Iron Framework using form Posts. |
homepage | |
repository | https://github.com/AlexanderElias/rust-sendmail |
max_upload_size | |
id | 2653 |
size | 5,388 |
Rust sending emails via sendmail.
Required:
* Note these instructions assume a Ubuntu machine
Run Commands:
apt-get install sendmail
nano /etc/hosts
Edit: 127.0.0.1 localhost localhost.localdomain HOSTNAME_IF_YOU_HAVE ONE
Run Commands:
/etc/init.d/networking stop
/etc/init.d/networking start
Run Command:
sendmailconfig
* Y to everything
extern crate sendmail;
use sendmail::email;
fn main() {
// Configure email body and header
email::send(
// From Address
"from.email@example.com",
// To Address
&["to.email@example.com"],
// Subject
"Subject - Hello World!",
// Body
"<html><body><h1>I am the body. Hello Wolrd!<br/><br/>And I accept html.</h1></body></html>"
).unwrap();
}