我正在尝试运行一个带有文本文件的脚本,使用Archive :: Zip压缩它,并使用Email :: Sender通过smtp将zip文件作为附件发送以创建mime消息.
我可以在perl中发送txt文件而不会损坏.我可以手动发送perl拉链文件而不会损坏.我无法通过perl发送手动压缩文件.
我怀疑我的问题是读取压缩文件或创建MIME消息.这是相关代码,它本质上是Email :: MIME概要中的代码,其中$ fileToSend是压缩文件的路径.
有任何想法吗?
use strict;
use warnings;
use Email::MIME;
use Email::Sender::Transport::SMTP;
use Email::Sender::Simple qw(sendmail);
use Archive::Zip qw( :ERROR_CODES :CONSTANTS);
use IO::All;
my $message =
Email::MIME->create(
header_str => [
From => $sender,
To => $recipient,
Subject => $subject,
],
attributes => {
filename => $filename,
content_type => 'application/zip',
disposition => 'attachment',
name => $filename,
},
body => io($fileToSend)->binary->all,
#body => io($fileToSend)->all,
);
Run Code Online (Sandbox Code Playgroud) 我想使用 netbeans 迁移到 Java 11 和 JFX11。JFX11 必须用作模块,所以我添加了 JavaFX jars 并在默认包文件夹下的 module-info.java 中添加了以下内容。
requires javafx.controls;
requires javafx.base;
requires javafx.fxml;
requires javafx.graphics;
requires javafx.swing;
requires java.logging;
requires java.desktop;
requires java.sql;
requires java.xml;
Run Code Online (Sandbox Code Playgroud)
这导致我的所有其他依赖项显示“pacakges 'xyz' 不可见......(包 'xyz' 在未命名的模块中声明,但模块 'xyz' 不读取它)”当我尝试清理和9.在netbeans中构建
我不能混合模块和库吗?我错过了什么?
java javafx java-platform-module-system java-module javafx-11
java ×1
java-module ×1
java-platform-module-system ×1
javafx ×1
javafx-11 ×1
perl ×1
smtp ×1
zip ×1