Open chendelin1982 opened 3 years ago
SMTP on Hongkong instance work well
I have put a test script test.rb in /opt/canvaslms/apps/canvaslms/htdoc
The content is `msgstr = <<END_OF_MESSAGE From: name from@example.com To: to name to@example.com Subject: test message Date: Wed, 10 Mar 2021 16:46:43 +1100 Message-Id: unique.message.id.string@example.com
This is a test message. END_OF_MESSAGE require 'net/smtp' Net::SMTP.start('smtp_server', 587, 'smtp_server', 'email_username', 'email_password', :plain) do |smtp| smtp.send_message msgstr, 'from_email', 'to_email' puts caller end`
and run:
ruby test.rb
The email can be sent successfully.
Send email script refers to this document: https://ruby-doc.org/stdlib-2.5.3/libdoc/net/smtp/rdoc/Net/SMTP.html
In Hongkong server, I also need to uncomment this line to be able to send email:
/opt/canvaslms/apps/canvaslms/htdocs/config/environments/production.rb line 49
config.action_mailer.raise_delivery_errors = true
Describe the bug
All SMTP setting is correct, but I can not send mail by SMTP
Deployment method
Bug source
System Environment
Application Version
e.g v4.5
OS
Cloud PlatForm
Bug reproduce
Steps to reproduce the behavior:
Bug reports
Bug Context
Bug context includes bug error, error logs and service status, it is very important for resolving issue
Bug Screenshot
paste screenshot here
Your suggestion
The reason of Bug
You can describe the reason if you have found it
Your solution for Bug
You can describe your solution here
Additional context
You can add any other context about the problem here.