Allow multiple To addresses in SimpleSendableMail

Because the struct internally stores a `Vec<String>` it would be nice to be able to construct messages with multiple To addresses.
This is in its current form a breaking API change, so feel free to change the way it's implemented.
This commit is contained in:
Lorenz Brun
2015-12-05 00:10:24 +01:00
parent b7ac3a897f
commit 6ee7fdb3d1

View File

@@ -219,10 +219,10 @@ pub struct SimpleSendableEmail {
impl SimpleSendableEmail {
/// Returns a new email
pub fn new(from_address: &str, to_address: &str, message: &str) -> SimpleSendableEmail {
pub fn new(from_address: &str, to_address: Vec<String>, message: &str) -> SimpleSendableEmail {
SimpleSendableEmail {
from: from_address.to_string(),
to: vec![to_address.to_string()],
to: to_address,
message: message.to_string(),
}
}