mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 09:26:54 -06:00
tasks/emails.rake: catch exception and puts message (#12024)
* tasks/emails.rake: catch exception and puts message * add username and auth
This commit is contained in:
parent
ad7ca46231
commit
1a159de36f
@ -78,7 +78,7 @@ task 'emails:test', [:email] => [:environment] do |_, args|
|
||||
STR
|
||||
end
|
||||
|
||||
puts "Testing sending to #{email} using #{smtp[:address]}:#{smtp[:port]}."
|
||||
puts "Testing sending to #{email} using #{smtp[:address]}:#{smtp[:port]}, username:#{smtp[:user_name]} with #{smtp[:authentication]} auth."
|
||||
|
||||
# We would like to do this, but Net::SMTP errors out using starttls
|
||||
#Net::SMTP.start(smtp[:address], smtp[:port]) do |s|
|
||||
@ -169,8 +169,9 @@ task 'emails:test', [:email] => [:environment] do |_, args|
|
||||
begin
|
||||
puts "Sending to #{email}. . . "
|
||||
Email::Sender.new(TestMailer.send_test(email), :test_message).send
|
||||
rescue
|
||||
rescue => error
|
||||
puts "Sending mail failed."
|
||||
puts error.message
|
||||
else
|
||||
puts <<~STR
|
||||
Mail accepted by SMTP server.
|
||||
|
Loading…
Reference in New Issue
Block a user