1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
mod common; use std::env; use crate::common::{Auth, run_smtps}; /// End-to-end test against the Gmail SMTP submission service. /// /// # Example /// /// ```sh /// GMAIL_EMAIL=test@gmail.com \ /// GMAIL_APP_PASSWORD=xxx \ /// cargo test --test gmail -- --ignored /// ``` #[test] #[ignore = "requires GMAIL_{EMAIL,APP_PASSWORD} env vars and --ignored"] fn gmail() { let email = env::var("GMAIL_EMAIL").expect("GMAIL_EMAIL not set"); let password = env::var("GMAIL_APP_PASSWORD").expect("GMAIL_APP_PASSWORD not set"); run_smtps( "smtp.gmail.com", 465, Auth::Plain { username: email.clone(), password, }, &email, ); }