Module: GGSM::Email

Included in:
MR
Defined in:
lib/ggsm/mr/email.rb

Instance Method Summary collapse

Instance Method Details

#send_email(user, title, msg) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/ggsm/mr/email.rb', line 6

def send_email(user,title,msg)
  message = "From: GGSM Merge Request <[email protected]>\nTo: \u738B\u53F3\u53F3 <[email protected]>,\u738B\u9521\u81E3 <[email protected]>,\u6C88\u82E5\u5DDD <[email protected]>,\u6731\u4E45\u8A00 <[email protected]>\nSubject: [\#{user}] \#{title}\n\n\#{msg}\n"

  Net::SMTP.start('smtp.163.com', 25, 'YoKey',
                  '[email protected]', 'able180896919') do |smtp|
    smtp.send_message message,
                      '[email protected]',
                      '[email protected]',
                      '[email protected]',
                      '[email protected]',
                      '[email protected]'
  end
end