From a559440c7ee1b4f9f42e6e478fbce107111fd8d5 Mon Sep 17 00:00:00 2001 From: David Zuckerman Date: Fri, 16 Jan 2026 10:06:12 -0800 Subject: [PATCH] setting tls to 465. was having issues sending email through campus network removed starttls_auto and using tls: true instead, using logging.error as opposed to info for error --- lib/mailer.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/mailer.rb b/lib/mailer.rb index 7e0fcd5..85e18da 100644 --- a/lib/mailer.rb +++ b/lib/mailer.rb @@ -24,11 +24,11 @@ def self.send_message(subject,body,attachments=nil) from_email = "lib-noreply@berkeley.edu" options = {:address => "smtp.gmail.com", - :port => 587, + :port => 465, :user_name => mail_envs["MAIL_USERNAME"], :password => mail_envs["MAIL_PASSWORD"], :authentication => 'plain', - :enable_starttls_auto => true, + :tls => true, :return_response => true } @@ -48,12 +48,11 @@ def self.send_message(subject,body,attachments=nil) add_file attachment if File.file?(attachment) end end + logger.info "Email sent" rescue StandardError => e - logger.info "Error sending email: #{e}" + logger.error "Error sending email: #{e}" end end - - logger.info "Email sent" #sleeping for 2 seconds so emails don't get flagged for spamming sleep 2