Skip to content

Commit eaf540b

Browse files
author
David Zuckerman
committed
setting tls to 465. was having issues sending email through campus network
1 parent 3311ba9 commit eaf540b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/mailer.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ def self.send_message(subject,body,attachments=nil)
2424
from_email = "[email protected]"
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+
:tls => true,
3132
:enable_starttls_auto => true,
3233
:return_response => true
3334
}
@@ -48,12 +49,11 @@ def self.send_message(subject,body,attachments=nil)
4849
add_file attachment if File.file?(attachment)
4950
end
5051
end
52+
logger.info "Email sent"
5153
rescue StandardError => e
5254
logger.info "Error sending email: #{e}"
5355
end
5456
end
55-
56-
logger.info "Email sent"
5757

5858
#sleeping for 2 seconds so emails don't get flagged for spamming
5959
sleep 2

0 commit comments

Comments
 (0)