Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Dec 7th, 2018 60 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1.   # Sends mail to several recipients.
  2.   #
  3.   # param recipients - an array of addresses ex ["kim@armada.nu", "tobias@armada.nu", " otto@armada.nu"]
  4.   def send_mail recipients, subject, message
  5.     require 'net/smtp'
  6.    
  7.     Net::SMTP.start('localhost', 25) do |smtp|
  8.       smtp.open_message_stream('noreply@niwen.armada.nu', to) do |f|
  9.        
  10.         f.puts "From: noreply@niwen.armada.nu"
  11.         f.puts "To: " + recipients[0]
  12.         f.puts "Bcc: " + recipients[1 .. recipients.length].join(', ')
  13.         f.puts "Subject: #{subject}"
  14.         f.puts "MIME-Version: 1.0"
  15.         f.puts "Content-type: text/html"
  16.         f.puts message
  17.       end
  18.     end
  19.  
  20.   end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top