我正在尝试在我的 Windows 平台上安装 scmbug。我在以下方法中将哈希作为参考错误。查看“HERE”注释以了解它发生的位置。
我应该用其中的 $mail 替换每个 %mail 吗?
我试过这个,但有其他错误。说
全局符号“$mail”需要明确的包名
如何解决这个问题?
sub mail_notification_send_mail {
my $self = shift;
my ($request, $subject, $message, $mailing_list) = ( @_ );
my %mail;
# Set values. This permits users to override the default behavior
# of Mail::Sendmail
%mail = \%{ $request->{ policies }->{ mail_notification }->{ mail_settings } };
%mail->{ 'X-Mailer' } = "Mail::Sendmail version $Mail::Sendmail::VERSION"; HERE
%mail->{ Subject } = $subject; HERE
%mail->{ Message } = $message; HERE
#
# Since we just reset %mail to values, we haven't really picked up
# the To,From,Reply-To that were computed. We do this next
#
# Don't blindly ignore the To list that was computed
my $mailing_list_to = $self->emails_to_csv( $mailing_list->{ To } );
%mail->{ To } = $mailing_list_to; HERE
# Don't blindly ignore the From list that was computed
my $mailing_list_from = $self->emails_to_csv( $mailing_list->{ From } );
%mail->{ From } = $mailing_list_from; HERE
# Don't blindly ignore the 'Reply-To' list that was computed
my $mailing_list_replyto = $self->emails_to_csv( $mailing_list->{ 'Reply-To' } );
%mail->{ 'Reply-To' } = $mailing_list_replyto; HERE
if ( !sendmail(%mail) ) {
my $msg = "Sending mail on " . $request->{ name } .
" failed. Log error was:\n" . $Mail::Sendmail::error . "\n";
$request->add_result(1, $msg);
}
}
谢谢