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 = <<END_OF_MESSAGE
From: GGSM Merge Request <[email protected]>
To: 王右右 <[email protected]>,沈若川 <[email protected]>,刘林儒 <[email protected]>,朱久言 <[email protected]>
Subject: [#{user}] #{title}

#{msg}
END_OF_MESSAGE

  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