Skip to content

Commit ce9dd4f

Browse files
authored
Merge pull request #6 from natecundiff/main
2 parents 35971d6 + b3b23df commit ce9dd4f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/commands.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub fn send(to: String, path: String, config_dir: &PathBuf) {
4242
let body = "This is a message from Atmail!".to_string();
4343

4444
let file_path = Path::new(&path);
45-
let filename = String::from("file");
45+
let filename = String::from(file_path.file_name().expect("Failed to retrieve file name").to_str().expect("File name is invalid"));
4646

4747
let filebody = fs::read(file_path).unwrap();
4848
let mime_guess = mime_from_path(file_path).first_or_octet_stream();

0 commit comments

Comments
 (0)