On Fri, Oct 23, 2020 at 11:36:05AM +0800, Luan Shengde wrote:
On Fri, Oct 23, 2020 at 11:20:21AM +0800, Xiao Shenwei wrote:
On Fri, Oct 23, 2020 at 10:56:28AM +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'],
i thank should name it email_addr
it's keyword for smtp config
ok,
Thanks, Shenwei
Thanks Luan Shengde
Thanks, Shenwei
- password: ENV['ROBOT_EMAIL_PASSWORD'],
- openssl_verify_mode: 'none',
- enable_starttls_auto: true
+}
+Mail.defaults { delivery_method :smtp, smtp }
2.23.0