Compare commits

..

No commits in common. "966254807c39136421e9dc4d6167b333788b3e72" and "4f6dacb907dee3037f3f2c6b37319aed4bb44848" have entirely different histories.

View File

@ -52,17 +52,15 @@ impl Mail {
let content = fs::read(temp_file.path().unwrap()).unwrap(); let content = fs::read(temp_file.path().unwrap()).unwrap();
let media_type = format!("{}", temp_file.content_type().unwrap().media_type()); let media_type = format!("{}", temp_file.content_type().unwrap().media_type());
let content_type = ContentType::parse(&media_type).unwrap(); let content_type = ContentType::parse(&media_type).unwrap();
if let Some(name) = temp_file.name() {
let attachment = Attachment::new(format!( let attachment = Attachment::new(format!(
"{}.{}", "{}.{}",
name, temp_file.name().unwrap(),
temp_file.content_type().unwrap().extension().unwrap() temp_file.content_type().unwrap().extension().unwrap()
)) ))
.body(content, content_type); .body(content, content_type);
multipart = multipart.singlepart(attachment); multipart = multipart.singlepart(attachment);
} }
}
let email = email.subject(data.subject).multipart(multipart).unwrap(); let email = email.subject(data.subject).multipart(multipart).unwrap();