A platform for community discussion. Free, open, simple.
tasks/emails.rake: catch exception and puts message (#12024)
T1a159de36f4f
diff --git a/lib/tasks/emails.rake b/lib/tasks/emails.rakeindex 45194afbfd4..4f16571030f 100644--- a/lib/tasks/emails.rake+++ b/lib/tasks/emails.rake@@ -78,7 +78,7 @@ task 'emails:test', [:email] => [:environment] do |_, args|STRend- 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|beginputs "Sending to #{email}. . . "Email::Sender.new(TestMailer.send_test(email), :test_message).send- rescue+ rescue => errorputs "Sending mail failed."+ puts error.messageelseputs <<~STRMail accepted by SMTP server.