On Fri, Oct 16, 2020 at 02:06:56PM +0800, Luan Shengde wrote:
add setup smtp for qq mail server enable send mail via smtp.qq.com
Signed-off-by: Luan Shengde luanshengde2@huawei.com
container/send-mail/send-mail.rb | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-)
diff --git a/container/send-mail/send-mail.rb b/container/send-mail/send-mail.rb index f459e78..844cad5 100755 --- a/container/send-mail/send-mail.rb +++ b/container/send-mail/send-mail.rb @@ -5,15 +5,29 @@
require 'mail'
-mail_server = `/sbin/ip route |awk '/default/ {print $3}'`.chomp +# mail_server = `/sbin/ip route |awk '/default/ {print $3}'`.chomp
Remove instead of comment out?
-Mail.defaults { delivery_method :smtp, smtp } +def internet_smtp
- smtp = {
- address: (ENV['SMTP_SERVER_ADDR']).to_s,
- port: (ENV['SMPT_SERVER_PORT']),
SMPT => SMTP
- domain: (ENV['EMAIL_DOMAIN']).to_s,
- user_name: (ENV['EMAIL_ADDR']).to_s,
user_name == EMAIL_ADDR?
- password: (ENV['EMAIL_PSWD']).to_s,
PSWD => PASSWORD
Thanks, Fengguang