Skip to content

Commit a559440

Browse files
author
David Zuckerman
committed
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
1 parent 02dc1ce commit a559440

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/mailer.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ def self.send_message(subject,body,attachments=nil)
2424
from_email = "lib-noreply@berkeley.edu"
2525

2626
options = {:address => "smtp.gmail.com",
27-
:port => 587,
27+
:port => 465,
2828
:user_name => mail_envs["MAIL_USERNAME"],
2929
:password => mail_envs["MAIL_PASSWORD"],
3030
:authentication => 'plain',
31-
:enable_starttls_auto => true,
31+
:tls => true,
3232
:return_response => true
3333
}
3434

@@ -48,12 +48,11 @@ def self.send_message(subject,body,attachments=nil)
4848
add_file attachment if File.file?(attachment)
4949
end
5050
end
51+
logger.info "Email sent"
5152
rescue StandardError => e
52-
logger.info "Error sending email: #{e}"
53+
logger.error "Error sending email: #{e}"
5354
end
5455
end
55-
56-
logger.info "Email sent"
5756

5857
#sleeping for 2 seconds so emails don't get flagged for spamming
5958
sleep 2

0 commit comments

Comments
 (0)