Guest User

Untitled

a guest
Apr 25th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #!/usr/bin/env ruby
  2.  
  3. require 'mailread'
  4. require 'net/smtp'
  5. require 'stringio'
  6.  
  7. SMTP_SERVER = ''
  8. SMTP_USERNAME = ''
  9. SMTP_PASSWORD = ''
  10.  
  11. stdin = StringIO.new STDIN.read
  12.  
  13. email = stdin.read
  14. stdin.rewind
  15. header = Mail.new(stdin).header
  16.  
  17. smtp = Net::SMTP.new SMTP_SERVER
  18. smtp.start('localhost.localdomain', SMTP_USERNAME, SMTP_PASSWORD,
  19. :login) do |smtp|
  20. smtp.send_mail(email, header['From'], header['To'])
  21. end
Add Comment
Please, Sign In to add comment