我正試圖在我的Windows平臺上安裝scmbug。 我在下面的方法中將哈希視爲引用錯誤。看到「這裏」註釋,看看它發生了什麼。不推薦使用哈希作爲參考 - Perl
我應該用每個郵件中的$ 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);
}
}
感謝
你的第一行應該是我的%哈希我認爲 –
@ Disco3,我已經編輯它並徹底改變了我的答案。我沒有注意到他正在將一個hashref分配到一個散列中。不管怎樣,謝謝你。 – gpojd
它的工作..謝謝 – Javanator