setup smtp for sending internet email: smtp setup for: smtp.qq.com
Signed-off-by: Luan Shengde luanshengde2@huawei.com --- lib/internet-smtp.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 lib/internet-smtp.rb
diff --git a/lib/internet-smtp.rb b/lib/internet-smtp.rb new file mode 100644 index 0000000..2e51d8f --- /dev/null +++ b/lib/internet-smtp.rb @@ -0,0 +1,18 @@ +#!/usr/bin/env ruby +# SPDX-License-Identifier: MulanPSL-2.0+ +# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved. +# frozen_string_literal: true + +require 'mail' + +smtp = { + address: 'smtp.qq.com', + port: 25, + domain: 'qq.com', + user_name: ENV['ROBOT_EMAIL_ADDRESS'], + password: ENV['ROBOT_EMAIL_PASSWORD'], + openssl_verify_mode: 'none', + enable_starttls_auto: true +} + +Mail.defaults { delivery_method :smtp, smtp }
This can be moved to container/send-internet-mail/run.rb
Thanks, Fengguang
On Fri, Oct 23, 2020 at 04:33:14PM +0800, Luan Shengde wrote:
setup smtp for sending internet email: smtp setup for: smtp.qq.com
Signed-off-by: Luan Shengde luanshengde2@huawei.com
lib/internet-smtp.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 lib/internet-smtp.rb
diff --git a/lib/internet-smtp.rb b/lib/internet-smtp.rb new file mode 100644 index 0000000..2e51d8f --- /dev/null +++ b/lib/internet-smtp.rb @@ -0,0 +1,18 @@ +#!/usr/bin/env ruby +# SPDX-License-Identifier: MulanPSL-2.0+ +# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved. +# frozen_string_literal: true
+require 'mail'
+smtp = {
- address: 'smtp.qq.com',
- port: 25,
- domain: 'qq.com',
- user_name: ENV['ROBOT_EMAIL_ADDRESS'],
- password: ENV['ROBOT_EMAIL_PASSWORD'],
- openssl_verify_mode: 'none',
- enable_starttls_auto: true
+}
+Mail.defaults { delivery_method :smtp, smtp }
2.23.0
On Mon, Oct 26, 2020 at 11:55:43AM +0800, Wu Fengguang wrote:
This can be moved to container/send-internet-mail/run.rb
I got it
Thanks Luan Shengde
Thanks, Fengguang
On Fri, Oct 23, 2020 at 04:33:14PM +0800, Luan Shengde wrote:
setup smtp for sending internet email: smtp setup for: smtp.qq.com
Signed-off-by: Luan Shengde luanshengde2@huawei.com
lib/internet-smtp.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 lib/internet-smtp.rb
diff --git a/lib/internet-smtp.rb b/lib/internet-smtp.rb new file mode 100644 index 0000000..2e51d8f --- /dev/null +++ b/lib/internet-smtp.rb @@ -0,0 +1,18 @@ +#!/usr/bin/env ruby +# SPDX-License-Identifier: MulanPSL-2.0+ +# Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved. +# frozen_string_literal: true
+require 'mail'
+smtp = {
- address: 'smtp.qq.com',
- port: 25,
- domain: 'qq.com',
- user_name: ENV['ROBOT_EMAIL_ADDRESS'],
- password: ENV['ROBOT_EMAIL_PASSWORD'],
- openssl_verify_mode: 'none',
- enable_starttls_auto: true
+}
+Mail.defaults { delivery_method :smtp, smtp }
2.23.0