📄 ikonmail.lib
字号:
##############################################################
# Ikonboard v2.1
# Copyright 2000 Ikondiscussion.com - All Rights Reserved
# Ikondiscussion is a trademark of Ikondiscussion.com
#
# Software Distributed by: Ikondiscussion.com
# Visit us online at http://www.ikondiscussion.com
# Email us on boards@ikondiscussion.com
#
# All files written by Matthew Mecham(Unless otherwise stated)
##############################################################
#
# Mail function library. Some functions based on sendmail.pm
#
# By Milivoj Ivkovic
#
##############################################################
sub sendmail {
if ($emailtype eq "send_mail") { $SMTP_SERVER = ""; }
if ($emailtype eq "smtp_mail") { $SEND_MAIL = ""; }
if ($emailtype ne "blat_mail") {
my ($fromaddr, $replyaddr, $to, $smtp, $subject, $message) = @_;
$to =~ s/[ \t]+/, /g;
$fromaddr =~ s/.*<([^\s]*?)>/$1/;
$replyaddr =~ s/.*<([^\s]*?)>/$1/;
$replyaddr =~ s/^([^\s]+).*/$1/;
# $message =~ s/^\./\.\./gm;
# $message =~ s/\r\n/\n/g;
# $message =~ s/\n/\r\n/g;
$smtp =~ s/^\s+//g;
$smtp =~ s/\s+$//g;
if ($SMTP_SERVER ne "") {
eval {
($0 =~ m,(.*)/[^/]+,) and unshift (@INC, "$1");
($0 =~ m,(.*)\\[^\\]+,) and unshift (@INC, "$1");
require "SendMail.pm";
};
if ($@) {
print header(-charset=>"gb2312"); print start_html(-title=>"ib2000 出错!");
print "不能够找到文件:$@\n如果您使用的是 Windows 类操作系统,请在每一个程序中更改 require 的设置,填入绝对路径!";
print end_html; exit;
}
eval("use MIME::Base64;");
print "Error: $@" if $@;
eval("use MIME::QuotedPrint;");
print "Error: $@" if $@;
$message.= "\nib2000 论坛 技术支持:http://www.leoBBS.com/\n";
$message.= "中文版权:CGI 编程者之家 http://www.CGIer.com/\n";
my($sender) = $fromaddr;
my($subject) = $subject;
my($recipient) = $to;
my($sm) = new SendMail($smtp);
$sm->From($sender);
$sm->To($recipient);
$sm->ReplyTo($replyaddr);
$sm->Subject($subject);
$sm->setMailHeader("URL", "http://www.CGIer.com");
$sm->setMailBody($message);
if ($sm->sendMail() != 0) {
return(1);
}
}
if ($SEND_MAIL ne "") {
open (MAIL,"| $SEND_MAIL -t");
print MAIL "To: $to\n";
print MAIL "From: $fromaddr\n";
print MAIL "Reply-to: $replyaddr\n" if $replyaddr;
print MAIL "X-Mailer: Perl Powered Socket Mailer\n";
print MAIL "Subject: $subject\n\n";
print MAIL "$message";
print MAIL "\nib2000 论坛 技术支持:http://www.leoBBS.com/\n";
print MAIL "中文版权:CGI 编程者之家 http://www.CGIer.com/\n";
print MAIL "\n.";
close(MAIL);
}
} # end SMTP, or sendmail
else { #blat
$tempfile = "$ikondir" . "tempfile.txt";
open(FILE,">$tempfile");
print FILE "$message";
close(FILE);
open(MAIL,"|blat $tempfile -t \"$to\" -b \"$bccinfo\" -i \"$fromaddr\" -f \"$fromaddr\" -s \"$subject\"");
close(MAIL);
}
} # end routine
1;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -