Prepare 0.1.0
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
|
||||
name = "smtp"
|
||||
version = "0.0.15"
|
||||
version = "0.1.0"
|
||||
description = "Simple SMTP client"
|
||||
readme = "README.md"
|
||||
documentation = "http://amousset.github.io/rust-smtp/smtp/"
|
||||
@@ -18,10 +18,10 @@ log = "0.3"
|
||||
rustc-serialize = "0.3"
|
||||
rust-crypto = "0.2"
|
||||
bufstream = "0.1"
|
||||
email = "*"
|
||||
email = "0.0"
|
||||
|
||||
[dev-dependencies]
|
||||
env_logger = "*"
|
||||
env_logger = "0.3"
|
||||
|
||||
[features]
|
||||
unstable = []
|
||||
|
||||
@@ -13,16 +13,15 @@ extern crate env_logger;
|
||||
extern crate smtp;
|
||||
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::collections::HashSet;
|
||||
use std::thread;
|
||||
|
||||
use smtp::sender::{Sender, SenderBuilder};
|
||||
use smtp::sender::SenderBuilder;
|
||||
use smtp::email::EmailBuilder;
|
||||
|
||||
fn main() {
|
||||
env_logger::init().unwrap();
|
||||
|
||||
let mut sender = Arc::new(Mutex::new(SenderBuilder::localhost().hello_name("localhost")
|
||||
let sender = Arc::new(Mutex::new(SenderBuilder::localhost().hello_name("localhost")
|
||||
.enable_connection_reuse(true).build()));
|
||||
|
||||
let mut threads = Vec::new();
|
||||
@@ -30,13 +29,13 @@ fn main() {
|
||||
|
||||
let th_sender = sender.clone();
|
||||
threads.push(thread::spawn(move || {
|
||||
println!("thpouet");
|
||||
let email = EmailBuilder::new()
|
||||
.to("user@localhost")
|
||||
.from("user@localhost")
|
||||
.body("Hello World!")
|
||||
.subject("Hello")
|
||||
.build();
|
||||
|
||||
let email = EmailBuilder::new()
|
||||
.to("user@localhost")
|
||||
.from("user@localhost")
|
||||
.body("Hello World!")
|
||||
.subject("Hello")
|
||||
.build();
|
||||
|
||||
let _ = th_sender.lock().unwrap().send(email);
|
||||
}));
|
||||
|
||||
@@ -28,3 +28,5 @@ impl Connector for SmtpStream {
|
||||
/// Represents an atual SMTP network stream
|
||||
//Used later for ssl
|
||||
pub type SmtpStream = TcpStream;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user