Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env ruby
- require 'mailread'
- require 'net/smtp'
- require 'stringio'
- SMTP_SERVER = ''
- SMTP_USERNAME = ''
- SMTP_PASSWORD = ''
- stdin = StringIO.new STDIN.read
- email = stdin.read
- stdin.rewind
- header = Mail.new(stdin).header
- smtp = Net::SMTP.new SMTP_SERVER
- smtp.start('localhost.localdomain', SMTP_USERNAME, SMTP_PASSWORD,
- :login) do |smtp|
- smtp.send_mail(email, header['From'], header['To'])
- end
Add Comment
Please, Sign In to add comment