Skip to main content

mail_list/
lib.rs

1mod email_builder;
2pub use email_builder::*;
3
4mod errors;
5pub use errors::*;
6
7#[cfg(feature = "tokio-runtime")]
8mod mailer;
9#[cfg(feature = "tokio-runtime")]
10pub use mailer::*;
11
12#[cfg(feature = "tokio-runtime")]
13mod transport_builder;
14#[cfg(feature = "tokio-runtime")]
15pub use transport_builder::*;
16
17pub use email_address;
18
19#[cfg(feature = "tokio-runtime")]
20pub use lettre;
21
22#[cfg(test)]
23mod test_smtp_service {
24
25    // use crate::*;
26
27    // TODO
28    // #[test]
29    // fn test_secure_smtp() {
30    //     let runtime = tokio::runtime::Runtime::new().unwrap();
31
32    //     let creds = std::env::var("SMTP_AUTH").unwrap();
33
34    //     runtime.block_on(async move {
35    //         let mut mailer = SmtpsBuilder::new();
36    //         mailer
37    //             .set_from("Support <support@domain.tld>")
38    //             .set_hello_name("domain.tld")
39    //             .set_reply_to("Support <support@domain.tld>");
40    //         let mailer = mailer.build(&creds).unwrap();
41
42    //         let my_mail = EmailEnvelopeDetails::new()
43    //             .set_to("Foo Bar <foo@example.com>")
44    //             .set_subject("Mail Completed")
45    //             .set_body("Has been successful");
46    //         mailer.send(&my_mail).await.unwrap();
47    //     });
48    // }
49}