Documentation formatting
This commit is contained in:
@@ -7,12 +7,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
/*! SMTP commands [1] and ESMTP features [2] library
|
||||
|
||||
[1] https://tools.ietf.org/html/rfc5321#section-4.1
|
||||
[2] http://tools.ietf.org/html/rfc1869
|
||||
|
||||
*/
|
||||
//! SMTP commands and ESMTP features library
|
||||
|
||||
use std::fmt::{Show, Formatter, Result};
|
||||
use std::io::net::ip::Port;
|
||||
@@ -24,6 +19,7 @@ pub static SMTP_PORT: Port = 25;
|
||||
//pub static SUBMISSION_PORT: Port = 587;
|
||||
|
||||
/// SMTP commands
|
||||
///
|
||||
/// We do not implement the following SMTP commands, as they were deprecated in RFC 5321
|
||||
/// and must not be used by clients :
|
||||
/// SEND, SOML, SAML, TURN
|
||||
@@ -88,9 +84,11 @@ impl<T: Show + Str> Show for SmtpCommand<T> {
|
||||
#[deriving(Eq,Clone)]
|
||||
pub enum EsmtpParameter {
|
||||
/// 8BITMIME keyword
|
||||
///
|
||||
/// RFC 6152 : https://tools.ietf.org/html/rfc6152
|
||||
EightBitMime,
|
||||
/// SIZE keyword
|
||||
///
|
||||
/// RFC 1427 : https://tools.ietf.org/html/rfc1427
|
||||
Size(uint)
|
||||
}
|
||||
|
||||
@@ -7,11 +7,9 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
/*! Common definitions for SMTP
|
||||
|
||||
Needs to be organized later.
|
||||
|
||||
*/
|
||||
//! Common definitions for SMTP
|
||||
//!
|
||||
//! Needs to be organized later.
|
||||
|
||||
use std::strbuf::StrBuf;
|
||||
|
||||
|
||||
@@ -7,39 +7,30 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
/*! SMTP library
|
||||
|
||||
This library implements a simple SMTP client.
|
||||
|
||||
# What this client is NOT made for
|
||||
|
||||
*Send emails to public email servers.* It is not designed to smartly handle servers responses,
|
||||
to rate-limit emails, to make retries, and all that complicated stuff needed to politely talk to public
|
||||
servers.
|
||||
|
||||
What this client does is basically try once to send the email, and say if it worked. It should be
|
||||
used to transfer emails to a relay server,
|
||||
|
||||
The client tends to follow RFC 5321 (https://tools.ietf.org/html/rfc5321).
|
||||
|
||||
This is an SMTP client, and thus does NOT manages email content but only the enveloppe.
|
||||
|
||||
It also implements the following extensions :
|
||||
8BITMIME (RFC 6152 : https://tools.ietf.org/html/rfc6152)
|
||||
SIZE (RFC 1427 : https://tools.ietf.org/html/rfc1427)
|
||||
|
||||
# Usage
|
||||
|
||||
```
|
||||
let mut email_client: SmtpClient<StrBuf, TcpStream> = SmtpClient::new(StrBuf::from_str("localhost"), None, None);
|
||||
email_client.send_mail(StrBuf::from_str("<user@example.com>"), vec!(StrBuf::from_str("<user@example.org>")), StrBuf::from_str("Test email"));
|
||||
```
|
||||
|
||||
# Next steps:
|
||||
Add SSL/TLS support
|
||||
Add AUTH support
|
||||
|
||||
*/
|
||||
//! # Rust SMTP client
|
||||
//!
|
||||
//! The client does its best to follow RFC 5321 (https://tools.ietf.org/html/rfc5321).
|
||||
//!
|
||||
//! It also implements the following extensions :
|
||||
//!
|
||||
//! * 8BITMIME (RFC 6152 : https://tools.ietf.org/html/rfc6152)
|
||||
//! * SIZE (RFC 1427 : https://tools.ietf.org/html/rfc1427)
|
||||
//!
|
||||
//! ## What this client is NOT made for
|
||||
//!
|
||||
//! Send emails to public email servers. It is not designed to smartly handle servers responses,
|
||||
//! to rate-limit emails, to make retries, and all that complicated stuff needed to politely talk to
|
||||
//! public servers.
|
||||
//!
|
||||
//! What this client does is basically try once to send the email, and say if it worked. It should only be
|
||||
//! used to transfer emails to a relay server.
|
||||
//!
|
||||
//! ## Usage
|
||||
//!
|
||||
//! ```
|
||||
//! let mut email_client: SmtpClient<StrBuf, TcpStream> = SmtpClient::new(StrBuf::from_str("localhost"), None, None);
|
||||
//! email_client.send_mail(StrBuf::from_str("<user@example.com>"), vec!(StrBuf::from_str("<user@example.org>")), StrBuf::from_str("Test email"));
|
||||
//! ```
|
||||
|
||||
#![crate_id = "smtp#0.1-pre"]
|
||||
|
||||
@@ -48,7 +39,6 @@ email_client.send_mail(StrBuf::from_str("<user@example.com>"), vec!(StrBuf::from
|
||||
#![license = "MIT/ASL2"]
|
||||
#![crate_type = "lib"]
|
||||
|
||||
#![doc(html_root_url = "http://www.rust-ci.org/amousset/rust-smtp/doc/")]
|
||||
|
||||
#![feature(macro_rules)]
|
||||
#![deny(non_camel_case_types)]
|
||||
|
||||
Reference in New Issue
Block a user