summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Korber <p.korber@1aim.com>2018-08-22 18:59:35 +0200
committerPhilipp Korber <p.korber@1aim.com>2018-08-22 18:59:35 +0200
commit4df2ded1766a51b2757b50901cc3e70fb142c8ca (patch)
treee4d4e5d5a4f84fe6afba78a91f0060279e48831d
parent81bf39bef827f408b5e90d5afade934061b5d6ea (diff)
doc: more documentation
-rw-r--r--src/request.rs19
-rw-r--r--src/send_mail.rs2
2 files changed, 20 insertions, 1 deletions
diff --git a/src/request.rs b/src/request.rs
index 71f516f..a7a1f5d 100644
--- a/src/request.rs
+++ b/src/request.rs
@@ -68,6 +68,25 @@ fn mailaddress_from_mailbox(mailbox: &Mailbox) -> Result<MailAddress, EncodingEr
Ok(MailAddress::new_unchecked(address, needs_smtputf8))
}
+/// Generates envelop data based on the given Mail.
+///
+/// If a sender header is given smtp will use this
+/// as smtp from else the single mailbox in from
+/// is used as smtp from.
+///
+/// All `To`'s are used as smtp recipients.
+///
+/// **`Cc`/`Bcc` is currently no supported/has no
+/// special handling**
+///
+/// # Error
+///
+/// An error is returned if there is:
+///
+/// - No From header
+/// - No To header
+/// - A From header with multiple addresses but no Sender header
+///
pub fn derive_envelop_data_from_mail(mail: &Mail)
-> Result<smtp::EnvelopData, MailError>
{
diff --git a/src/send_mail.rs b/src/send_mail.rs
index bd49fc6..8730647 100644
--- a/src/send_mail.rs
+++ b/src/send_mail.rs
@@ -116,7 +116,7 @@ pub fn send_encoded_mails<I>(con: Connection, mails: I)
fut
}
-/// Send mails _to a specific mail server_.
+/// Send mails to _one_ specific mail server.
///
/// This encodes the mails, opens a connection, sends the mails over and
/// closes the connection again.