diff options
-rw-r--r-- | src/request.rs | 19 | ||||
-rw-r--r-- | src/send_mail.rs | 2 |
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. |