现在可以通过rake redmine📧test[guange] 发送测试邮件

This commit is contained in:
guange 2015-04-27 16:44:53 +08:00
parent 56f6fa0d86
commit 86347cab89
3 changed files with 13 additions and 12 deletions

View File

@ -817,12 +817,12 @@ class Mailer < ActionMailer::Base
headers[:references] = @references_objects.collect {|o| "<#{self.class.message_id_for(o)}>"}.join(' ')
end
set_language_if_valid @initial_language
super headers do |format|
format.text
format.html unless Setting.plain_text_mail?
end
set_language_if_valid @initial_language
end
def initialize(*args)

View File

@ -215,11 +215,12 @@ production:
# specific configuration options for development environment
# that overrides the default ones
development:
delivery_method: :smtp
smtp_settings:
address: mail.trustie.net
port: 25
domain: mail.trustie.net
authentication: :login
user_name: "mail@trustie.net"
password: "loong2010"
email_delivery:
delivery_method: :smtp
smtp_settings:
address: mail.trustie.net
port: 25
domain: mail.trustie.net
authentication: :login
user_name: "mail@trustie.net"
password: "loong2010"

View File

@ -186,9 +186,9 @@ END_DESC
ActionMailer::Base.raise_delivery_errors = true
begin
Mailer.with_synched_deliveries do
Mailer.test_email(user).deliver
end
# Mailer.with_synched_deliveries do
Mailer.test_email(user).deliver!
# end
puts l(:notice_email_sent, user.mail)
rescue Exception => e
abort l(:notice_email_error, e.message)