require 'uri' uri = URI::parse('mailto:[email protected]?Subject=Hello&body=Hi!') uri.dump puts uri.to_mailtext