Improve comments in smtp selfsigned example
This commit is contained in:
@@ -17,15 +17,16 @@ fn main() {
|
||||
.body("Be happy!")
|
||||
.unwrap();
|
||||
|
||||
// Use a custom certificate stored on disk to securely verify the server's certificate
|
||||
let pem_cert = fs::read("certificate.pem").unwrap();
|
||||
let cert = Certificate::from_pem(&pem_cert).unwrap();
|
||||
let mut tls = TlsParameters::builder("smtp.server.com".into());
|
||||
let mut tls = TlsParameters::builder("smtp.server.com".to_string());
|
||||
tls.add_root_certificate(cert);
|
||||
let tls = tls.build().unwrap();
|
||||
|
||||
let creds = Credentials::new("smtp_username".to_string(), "smtp_password".to_string());
|
||||
|
||||
// Open a remote connection to gmail
|
||||
// Open a remote connection to the smtp server
|
||||
let mailer = SmtpTransport::builder_dangerous("smtp.server.com")
|
||||
.port(465)
|
||||
.tls(Tls::Wrapper(tls))
|
||||
|
||||
Reference in New Issue
Block a user