sendmail

Rust sending emails via sendmail. Works nicely with Iron Framework using form Posts.

3 stable releases

Uses old Rust 2015

2.0.0 Mar 19, 2018
1.0.1 Jul 23, 2015
1.0.0 Jul 22, 2015

#184 in Email

Download history 6/week @ 2024-07-19 21/week @ 2024-07-26 198/week @ 2024-08-02 44/week @ 2024-08-09 21/week @ 2024-08-16 78/week @ 2024-08-23 204/week @ 2024-08-30 83/week @ 2024-09-06 115/week @ 2024-09-13 59/week @ 2024-09-20 57/week @ 2024-09-27 16/week @ 2024-10-04 7/week @ 2024-10-11 56/week @ 2024-10-18 15/week @ 2024-10-25 9/week @ 2024-11-01

87 downloads per month
Used in git-next

Custom license

4KB

Rust Sendmail

Rust sending emails via sendmail.

Required:

  1. linux/unix machine
  2. sendmail compatible software installed (postfix/exim4..)

* Note these instructions assume a Ubuntu machine

Step One

Install sendmail and configure

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

Step Two

Create Main.rs File

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();
}

No runtime deps