1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
# comment_mail-smtp.rb $Revision: 1.8 $
#
# SMTPץȥȤäƥĥåߤΤ餻
# ư
#
# Options:
# ̤Ǥ(ĥåߥϥץ饰):
# @options['comment_mail.enable']
# 뤫ɤꤹ롣true()false(ʤ)
# ̵false
# @options['comment_mail.header']
# Subject˻Ȥʸʬʤ褦˻ꤹ롣
# ºݤSubjectϡֻʸ:-1פΤ褦ˡդȥֹ椬
# դʸˡ%³ѻä硢
# եեޥåȻʤĤޤաפʬ
# ưŪղäʤʤ(ֹղä)
# ̵ˤ϶ʸ
# @options['comment_mail.receivers']
# 륢ɥ쥹ʸޤǶڤäʣǤ롣
# ̵ˤɮԤΥɥ쥹ˤʤ롣
#
# tdiary.confǤΤǤ:
# @options['comment_mail.smtp_host']
# @options['comment_mail.smtp_port']
# 줾졢˻ȤSMTPФΥۥ̾ȥݡֹ档
# ̵Ϥ줾'localhost'פȡ25ס
#
# Copyright (c) 2003 TADA Tadashi <sho@spc.gr.jp>
# You can distribute this file under the GPL.
#
def comment_mail( text, to )
begin
require 'net/smtp'
host = @conf['comment_mail.smtp_host'] || 'localhost'
port = @conf['comment_mail.smtp_port'] || 25
Net::SMTP.start( host, port ) do |smtp|
smtp.send_mail( text, @conf.author_mail.untaint, to )
end
rescue
$stderr.puts $!
end
end
add_update_proc do
comment_mail_send if @mode =~ /^(comment|trackbackreceive)$/
end
add_conf_proc( 'comment_mail', comment_mail_conf_label ) do
comment_mail_basic_setting
comment_mail_basic_html
end
|